To know how to protect your knife you need to know what may threaten it.
If you're talking about a stainless steel: then your biggest enemy is Halogens such as; Chloride (a common food preservative and on of the most common chemicals found in organic nature), Iodine (found in table salt and wound disinfectants), Chlorine and Chloramine (used to disinfect tap water). What is bad about Halogens for stainless steels is that almost all stainless steels use a relatively high percentage of Chromium. Which when coming in contact with oxygen instantaneously forms a self healing transparent layer of chromium oxide. This is what protects stainless steel from harmful corrosion. And Halogens break that barrier allowing the Iron component to then oxidize.
Usually your blade is not going to see long enough exposure to these in high enough concentrations to do any thing. But if you never clean your blade, you can get a build up of these over time from touching it with your filthy human hands

So just clean your blade once in a while. I like to hand rub mine with a paste made of extra virgin olive oil, baking soda, and soot from burned cork (0.5:1:1: ratio). Then I rinse with filtered tap water, and dab dry with a clean cotton cloth.
If you're talking about a strait carbon steel: Then your biggest enemy is Oxygen such as from air and water exposure. The easiest way to protect against this is with oiling your blade often. For heavier use blades (like an Axe or Machete) I like to heat them up (about 140°F-250°F usually), rub bee's wax into it and douse in ice cold water. This forms a longer lasting protective barrier (though it makes for greater surface friction, which is why I only use it for heavy duty blades, where it wont effect performance noticeably).
In either case Acid and galvanic corrosion are concerns. Many woods contain Tannic/Gallic acid, and most soil or food is going to contain some form of sodium or acid. Acid is all around and it can do everything from leaving a blade mottled (which I kind of like the look of on yard tools) and pitted, to even just leaving a perfect black, blue, purple or brown etching of your thumb print where you grabbed your folder last to open it. You can do this 999 times and not have this happen...But it's the one time where the conditions were just right that it that matters (Like if you were handling unseasoned live oak and didn't wash your hands or wipe your blade immediately).
And Galvanic corrosion can occur when two dissimilar metals come into contact with each other in the presence of an electrolytic solution. This is why you don't want to wash stainless with your silver plate in a dish washer.
As for getting rid of it when it happens...for light stuff I found I can just buff it out with my same paste I use for cleaning (where the problem is slight discoloration). For heavier damage I found that high grit sandpaper followed by polishing rouge with buff wheel works best (for mottling and fly spots). The hardest stuff to deal with is deep and oxidized pitting. Where it regards that I have had mild success with some unconventional experimentation (that still isn't any where near a solid advisable method yet).