A quick and simple explanation of what is going to happen is enough for children in this age group. You could, for example, talk about a doll or a toy that is unwell and needs to go to hospital. Point out where on the doll or toy the problem is, and explain that the same thing is going to happen with them. Avoid talking about what is in their body, or what is going to be done there, as small children do not understand such details.
Children under 3 years old do not have a proper sense of time, and so getting them prepared should not be done too early. The day before, or the day of the hospital visit is fine.