How can those people with body piercings and tattoos prevent infections?

Keep it clean. Before, during and immediately after the procedures, keep the area clean and protected. Once healed, tattoos are unlikely to become infected. Piercings, on the other hand, should be protected from further trauma, and if become red and painful, may need additional care or removal to prevent the spread of infection.