A chemical reaction in which a small molecule called a methyl group is added to other molecules. Methylation of proteins or nucleic acids may affect how they act in the body.