On a 2002 Dodge Ram 1500 5.9L (Magnum engine), the EGR valve is located on the passenger side of the engine, near the back, on the intake manifold. It's usually relatively easy to spot; it's a rectangular or square-shaped valve with vacuum lines connected to it. You might need a flashlight and possibly to remove some heat shields for better access.
However, the exact location can vary slightly depending on specific engine configurations and any aftermarket modifications. Consulting a repair manual specific to your year and engine would give you the most precise visual aid.