Also important waxing or oiling coats preventing future rust when done. Very important cast iron tops, also lathe beds. Johnsons paste wax good quality good price, also at home depot.
Good note on rust protection after youve done your cleaning. Personally to flush off any abrasive nasties after cleaning, i just use more WD-40 and some clean rags, so for most parts i dont need to do anything else. The WD-40 itself does a good enough job of rust protection on its own. If you use any sort of solvent to clean your parts afterwards, you definitely need to do something to keep rust at bay, be it WD-40, paste wax or other.
Now, sliding surfaces or anything that requires lubrication i treat differently. First things first, no WD-40, its not a lubricant. For most woodshop related things, PTFE dry lube is my go-to. WD-40 brand actually makes a PTFE spray lube in their specialist line, love the stuff. Dries to a film, not sticky, doesnt attract dust at all, and its incredibly slippery. I use it on... well, pretty much anything that doesnt explicitly call for a 'wet' lube. Pocket knives, door hinges, table saw height adjustment, planer pillars, bike chains, locks, squeaky casters, metal drawer slides, etc