Most lasers used in medicine, and all modern tattoo-removing lasers use pulses of light/energy to heat the target (in this case tiny tattoo granules in the skin) quickly enough to destroy and fracture them, but not long enough to burn the skin.
A similar situation is when someone touches a stove (don’t to this) to see if it’s on, a quick touch will not burn the skin, but linger and you’ll get a nasty reminder of how long it takes heat to spread from one surface to another. The smaller the particle, the shorter the pulse-duration necessary to remove that target without allowing heat to spread to surrounding skin.
Tattoo-removing lasers have pulse-durations in the nanosecond-domain (in the billionths of seconds), and newer tattoo-removing lasers have pulse-durations in the picosecond-domain (less than a billionth of a second).
How in the world do lasers generate such short pulses? They use a Q-switch or other optical mechanisms to generate such a short pulse, since no mechanical switch can move that quickly.