Run the engine so it's nice and warm, but not super hot. Cover up alternator, distributor, air filter(s), any other exposed electrical items (ignition boxes, external coils, etc.) with plastic bags and zip ties. Depending on what kind of dirt ur trying to wash away (use engine degreaser (gunk) for oily stuff or mild detergent for dust and regular dirt) wash everything with warm water and rinse preferably with warm water (pressure washers come in very handy for this kind of job... just be careful around air filters and other sensitive things) start engine immediately after washing everything to dry off and let idle for 15 or so minutes.
have fun!