The following information applies to the United States. Other countries may have similar or different laws.
A religious exemption requires a sincerely held religious belief but it does NOT have to be part of an organized religion. You do NOT need a letter from a member of the clergy. You do need to be able to express your belief in writing as a sincerely held religious belief. Although there are templates available for such a letter, it is advised that you do not "cut and paste" but instead use your own original clear language to express your beliefs.
One medical exemption is an allergy to an ingredient in the vaccines, such as polyethylene glycol (PEG). A 2016 study found 7% of the population may be allergic to it.
Jab Update has a guide to both religious and medical exemptions with helpful links.