The headrest is held in place with four clips that clip into the seat frame.
The top two clips are white and are very robust, the lower clips are black and seem
very fragile and will snap easily. You may want to get some replacements from smart.
Pull all four clips out, this can be made easier with a flat head screwdriver or upholstery tool.

This shows you the position of the holes in which the clips pass through.

As you can see, the white clips survive but the black clips don't.

Refitting is a case of reclipping the four clips back into the holes.
Seat Back Rest Removal