If people wish to leave their bodies for medical education or research, it is important for them to tell the family/relatives and to make the necessary arrangements before they die.
When the person dies, the family/relatives should contact HM Inspector of Anatomy who will advise on what needs to be done.
If a body is accepted (and many bodies are not suitable), the medical school will arrange for eventual cremation or burial.