Clean the area affected by the stain thoroughly using a mild detergent and water. This is generally effective for wood, tile, drywall and most other hard surfaces. If your hard surface is known to be sensitive to water or soap, use a method appropriate for the piece.
Dry the area thoroughly and sand it with a fine grit sandpaper, if appropriate. Sanding may be necessary on wood with a high-gloss finish or on drywall or plaster. Sanding will also reduce the amount of ink that appears on the surface.
Wipe any residual sanding dust away with a tack cloth.
Paint over the stain with a primer coat and allow it to dry thoroughly for up to 24 hours. If the rest of the wall or piece is painted, the primer may only need to go over the stained area. In order to maintain an even finish, you may need to repaint the whole piece or wall.
Apply the paint over the primed area and wait until it dries to determine whether another coat is required. A second coat may be necessary to even out the finished look.