Someone else may think that they need to take your freedom away to give you the care or treatment you need. If you are able to make an informed choice about this, it is your right to say no. The only time when your informed choice might be over-ridden is if you need to be detained under the Mental Health Act.
Deprivation of liberty could take place anywhere - in a care home or hospital, but also in your own home.
If you are not able to make an informed choice, the law says that whoever is looking after you cannot take your freedom away without independent checks that this is the best thing for you.
This law is set out in the Mental Health Act and the Mental Capacity Act.