A TEM operates by generating an electron beam using an electron gun, typically a tungsten filament or a field emission source. The beam is focused and directed through electromagnetic lenses, which control and shape the electron stream. As the electrons pass through the specimen, they are scattered based on the material's density and atomic structure. The transmitted electrons are then collected and focused to form an image on a fluorescent screen or a digital detector.