Nanoparticles can generate heat through various mechanisms. Magnetic nanoparticles like iron oxide can produce heat when exposed to an alternating magnetic field, a process known as magnetic hyperthermia. Alternatively, gold nanoparticles can absorb light and convert it into heat through a process called plasmonic photothermal therapy. These methods exploit the unique properties of nanoparticles to achieve localized heating.