I've experienced spark plug fouling before but it was during the pre-flight checks and my instructor fixed it for me (by using max RPM and leaning the mixture a couple of times). But now that I have to fly all by myself, I'd rather know what to do and what not to do, especially during flight. What happens if the plugs become fouled in the air, and how do I clean them in flight?
You should read up here but generally speaking plugs are less likely to foul in flight (and is why its not talked about much). Plugs often foul due to the mix of low engine temps and high led content during warm up at full rich settings. This is why a leaned out warm up is advised for some planes, you should talk with your instructor about the plane you are flying and what the proper warm up procedures are.
Please consult your POH for any airframe specific emergency checklists that may apply to your aircraft. Generally speaking if you depart with a fouled plug and it is causing a rough running issue you should cycle the magnetos untill you are running on the good set of plugs and get the plane down safely. This is most likely the result of a poor or non-existant run up check. Unless you are sitting in line for a long time after your runup, you should generally be doing runup close to departure time.
The best answer here is don't use an excessively rich mixture. That will avoid a lot of fouling problems on the plugs. Leaning during taxiing also helps. During flight betweeen SL and approx 4000 FT ASL, at full throttle lean the engine until the fuel flow indicator is at the top of the green arc. Above that level, do not operate the engine richer than 70 deg Rich Of Peak.