Methods to prepare nanohydrogels are disclosed that include functionalizing a polysaccharide with a hydrophobic compound to form a functionalized polysaccharide, and subjecting the functionalized polysaccharide to a self-assembling process in a water environment for the formation of the nanohydrogel. The hydrophobic compound is riboflavin, or a derivative thereof, to which an alkyl group having a functional group suited to form a covalent bond with the polysaccharide has been bonded.