Wearable nanosensors function by utilizing nanomaterials like carbon nanotubes, graphene, and quantum dots. These materials exhibit unique electrical, optical, and mechanical properties at the nanoscale, enabling them to detect minute changes in the environment or biological systems. The sensors convert these changes into electrical signals, which can be processed and analyzed to provide real-time data.