Check out Adam's Polishes website (or any detailing site that has videos). They have detailing videos on there that you can watch for free and there is one about washing under the hood area (Chapter 4). But make sure you cover up your alternator and air intake and that your engine is cool before you begin to wash or clean around it.
I use and all purpose cleaner, or something like simple green, and a soft brush to agitate the dirt, then rinse the engine bay. You can then let your car idle for a bit to dry everything.
I do highly reccommend watching the videos though since they are professionals and can show you more in detail than I have explained.
Good luck!!