Engine Compartment

This is how I would recommend you doing it at your experience level. There are other ways; this is my suggestion.
1. Take lots of pictures, label things like wires with masking tape, and then take off as much as you possibly can. Label all fasteners, clips, etc. with tape so you will know where they go.
2. CLEAN everything thoroughly. Use whatever you like, but all grease, oil, grime and dirt must be gone.
3. Time for sanding. All of the rusty areas need to be prepped. You can use a wire brush to get the loose rust, and then 220 or 320 grit dry sandpaper. When I say 220 or 320 grit 'dry', I mean the kind of paper you might sand wood with. It is completely different than the wet/dry sandpaper you will use later. You can get all the sandpaper you will need at Lowes od a car parts place. Get as much rust off as possible.
4. The look over all the rest of the areas to be painted. If there are any rough areas, smooth them out with 320 dry. Then everything else can be wet sanded with 320 grit wet/dry paper followed by 400 wet/dry. To wet sand, put a few drops of dish washing soap in a spray bottle full of water. Then spray the area to be sanded, and keep it damp while sanding by spraying frequently with the bottle.
5. Thoroughly dry the areas off. Compressed air works great. You cannot spray primer or paint until ALL water everywhere is gone. The rusty areas you worked on in step 3 may get a light coating of surface rust after getting wet. hit them with some 320 dry paper to get rid of it.
6. MASK, MASK, MASK. Anything you do not want paint on needs to be masked off. Overspray goes a long way, so keep that in mind.
7. Wipe down all places to get paint/primer with some pre paint wax and grease remover. Any car parts store that sells rattle can paint should have this. Wipe the wax and grease remover off with a lint free (microfiber) towel. Do smaller areas at a time.
8. Wear a mask and spray in a well-ventilated area! Spray a light coat of primer on all bare metal areas first. Then spray 3 medium coats of primer on the rest. Practice a side-to-side pattern with the primer trying to avoid runs. This will be good practice for when you spray the paint. Heavy coats of primer or paint WILL run. DupliColor high build spray can primer (car parts store) works great. I see @RustyRatRod agrees with me. Follow the directions on the can, but allowing a little more time between coats will allow the solvents to evaporate. Give the primer a few days to thoroughly dry. You want all solvents to be gone.
9. Time to prep the primer for paint. Here you can use scuffing pads. Green ones are fairly coarse. Use maroon (about the same as 400 grit) or grey (about 600 grit) pads if you can. You can do wet sanding here, but then you will have to re-do all your masking. Every square inch of primer must be scuffed. This scuffing gives mechanical adhesion for the paint to stick.
10. Wipe down with wax and grease remover just like above.
11. Spray one light coat on everything. You are NOT going for full coverage here. This first coat is called a tack coat. It gives the next coat something to 'stick' to and greatly reduces running. Follow up with 2 to 3 wet coats (not so wet as to run, but the paint should look shiny). Follow recommended times between coats. I assume you are doing single stage that does not require clear.
12. You are done. Wait at least an hour for the paint to dry enough before CAREFULLY removing all masking. You will know when the paint is dry enough by touching paint on masking tape.