According to the NHS, for consent to be valid, it must be voluntary and informed, and the person consenting must have the capacity to make the decision. That means the decision to either consent or not to consent to treatment must be made by the person, and not be influenced by pressure from medical staff. That person must have been given all of the information about what the treatment involves, including the benefits and risks, whether there are reasonable alternative treatments, and what will happen if treatment does not go ahead.
They finally must be capable of giving consent, which means they understand the information given to them and can use it to make an informed decision.