The temperature sending unit on a 2004 Chevy Cavalier is located on the
cylinder head, usually near the thermostat housing. It's a small sensor, often with one or two wires connected to it. You'll likely need to consult a repair manual specific to your 2004 Cavalier's engine (2.2L or 2.4L) for the precise location. A picture in the manual will be invaluable.
Because of the many variations in engine configuration, a general description isn't sufficient for pinpoint accuracy. Using a repair manual or online diagrams specific to your vehicle's year, make, and engine size is crucial to find the exact location.