The EGR valve on a 2004 Dodge Ram diesel (specifically the Cummins 5.9L) is located on the
intake manifold, towards the rear of the engine. It's often somewhat difficult to access, nestled amongst other components. You'll likely need to remove some heat shields or other parts to get a clear view and reach it.
A good picture of a 2004 Dodge Ram 5.9L Cummins engine bay, or a repair manual specific to that year and engine, will be invaluable in pinpointing its exact location. There's no single definitive visual since various components can be slightly different between model years and configurations.