I’m going to presume that you’ve got the ability to remove and install an engine with the related tools/hoists/etc. I’m also going to presume that you’ve got some well-ventilated place to paint an engine.
What you’ll need:
Some sort of engine cleaner/degreaser (Gunk Foamy Engine Brite is my personal favorite)
High temperature engine primer (I’d recommend gray primer)
High temperature engine paint (I’d recommend some light color to see oil leaks easier)
Painter’s masking tape (to seal off parts of teh engine that you don’t want to get paint on/in)
Wire brush to help remove the scuzz
Te same sort of saftey equipment you’d need when painting anything else with rattlecans (filter mask, eye protection, etc)
How to do it:
Once the engine is out and safely supported on something, put a large drain pan underneath of it and spray it down with the engine cleaner to get all the years of accumulated scuzz off of it. You may need to use a wire brush or something similar to get the places where the scuzz is really caked on. While the engine’s out, now would be a great time to replace any leaky gaskets and such that it may have. If it was my own engine, I’d remove the intake manifold and the exhaust manifold(s), as well as having a fresh set of spark plugs to put in (for maintenance reasons). If you’re going to remove the manifolds, make sure to seal off the holes in the heads that the manifolds used to cover, as you don’t want to get paint inside the engine.
Once you’ve got your engine nice and clean and dry, shake the can of primer for a while and then put a light coat of it all over everything. Lots of light coats is preferable to one heavy coat, as there will be less drips in the paint. Also, soaking the paint can in hot water can help with it’s spraying, but your mileage may vary. Allow 5 minutes or so of drying time between coats. Once you feel you’ve gotten enough primer on it, let it dry for 20 minutes or so, then repeat the procedure using the can(s) of paint. Again, if it was my engine getting painted, I’d probbaly use a light blue, or possibly green. Just make sure it’s some light color so you’ll be able to see any potential oil leaks easier. Let the whole ting dry overnight and be careful when you reinstall it because paint is easily damaged by metal things running into it.
I imagine that there’s more information available elsewhere on the Internet if this isn’t detailed enough for you, but I hope it helped.