there are many products out there specifically designed to clean a car's engine, like Gunk Engine Bright, and on the can it says to warm the engine, turn off the vehicle, spray on the product, allow to soak and then wash off. I have used other products like Simple Green (environmentally friendlier) and I just make sure all the electrical connections are not directly sprayed with the chemical or the water, always ensure your electrical connections are lubricated with a grease designed for the use, and allow the vehicle to dry thoroughly.
And yes, do not spray the alternator or distributor. Moisture of excess in those will be very detrimental.
The alternator is always belt-driven off the front of the engine, even on transverse-engine, front-wheel-drive vehicles.
The alternator has electrical wires running to it.
Most alternators are made of aluminum.
Most alternators have a small, built-in fan visible behind the belt pulley.
Check the owner's manual for more information. In many cases, you'll find a diagram of the engine compartment with the alternator and distributor identified.