Step 1: Don't rub it in
Whether it is on the floor, the wall or your clothes, do not rub at the stain in an attempt to remove it.
Step 2: Get to work right away
As soon as you notice the stain, gather your materials according to what the stain has affected:
Step 3: Start removing your stain
This may be scary (and a little smelly), but drench the stain in white vinegar. Once you have thoroughly soaked the stain, cover it with your bath towel and blot by pressing firmly onto the stain with your towel -- do not rub! You should see the ink or marker from your carpet begin to lift and seep into the towel. Repeat and repeat and repeat until the stain is fully lifted.
Wall or flooring
Try toothpaste first, as it will be most gentle on your surfaces. Apply directly onto your hand towel and gently rub stain in a circular motion. If this is not working, turn to the hand sanitizer and do the same. The hand sanitizer works on most surfaces, but if it does not, lightly spray with rubbing alcohol and dab out stain.
Try soaking your clothing in ice-cold water first. If this does not work, head for the hand sanitizer. Squirt some sanitizer onto a hand towel and begin gently rubbing into your clothing in a circular motion. It may take a while, but the stain should slowly lift. Make sure to rotate your hand towel, continuously using clean portions; be careful not to spread the ink or marker you have already removed back onto your clothing.
Step 4: Finish up
Now that the stain is gone, your carpet will be damp and likely not smell strongly of vinegar. If you have a steam vacuum, this is your best option for removing the vinegar and dampness. If not, try a wet/dry vac. You can use cold water with a bit of lemon juice to dampen the area again and suck up the moisture with the wet/dry vac. If you don't have a steam vacuum or wet/dry vac, spray water with a bit of the juice from a lemon mixed in over the area and continue to soak up the excess moisture with a towel, then face a fan towards the area until dry.
Wall or flooring
If you used toothpaste, your wall or floor may be left with a bit of a film -- just wipe it clean with a warm cloth. If you used hand sanitizer or rubbing alcohol, you should not see any remnants of either, but it wouldn't hurt to run a warm cloth over the area.
Once you are sure the stain is completely removed, you can wash as usual. Just to be safe, spray a bit of your favorite stain spray on the area to make sure you haven't missed a mark.
More on stain removal