Molecular motors operate by converting chemical or photonic energy into mechanical motion. This is achieved through a series of conformational changes in the molecular structure, often driven by the hydrolysis of ATP in biological systems or by light in artificial systems. These changes result in linear or rotational movement.