General rules of thumb:
If it's a new car or very recent, you should not have to worry too much. All the seals should still be perfect and unless you do something really stupid there should be no problem.
If it's an older engine, say 5 years or older, then you really should be carefull. I have had water pass the seals for the spark plugs and had engines misfires on one of the cylinder for over a week. Luckilly it was my own car and I was able to dry it out once I diagnosed the problem. Added di-electric grease on the plugs and after one more day of problems everything went back to normal.
The issue is that once the seals gets old enough they will dry and crack and let water in. In my case it did not result in major damage but it could have been something more sensitive.
I usually do not do engine details on engines older than 5 years. Also when I do one I ask the client to sign a Weaver regarding water that can get to areas where it will cause issues. No matter how carefull you are, if it does it can be a pain to deal with.
As for technique here is how I do it:
Spray the underside of the Hood with a degreaser. Agitate with a soft brush then rinse. Repeat if needed.
I cover the alternator up and any electrical items I think might be vulnerable to water. You can use plastic bags, aluminium foil or what ever you think will do the job. Then spray the whole engine with the degreaser. Again agitate with brushes, you will need at least 3 to cover the large areas, smaller areas and tight areas. I rinse with the fan setting on a low pressure gun. I guess you could use a power washer from a good distance away also. Trick is not to force water into anything. You use want the water to rinse the degreaser away, not act as a cleaning agent either by volume or pressure.
Most of the time you will have to repeat the steps a few times. It's also useful to have stronger cleaners on hand for very tough grease or oïl. I now keep a can of gunk engine cleaner for such spots. Someone on this forum told me they keep a small bottle of diesel fuel and use it with an old sock to remove those spots. Never tried it but it makes sense, use oïl to remove oïl.
Once the engine is clean, blow dry it with a leaf blower, metrovac sidekick or exaust of a vacuum cleaner.
Then protect with the product of your choice. Black plastic really makes the engine pop once dressed.
There are plenty of videos on techniques to do this on Youtube, just search for engine cleaning or engine detailing and you should find plenty.