To remove it, slide the special pen up and remove it.
To attach the pen, insert the tip of the pen slightly into the pen holder at the bottom, tilt the pen so that the locking part of the back cover fits into the groove on the back of the pen, and then slide it down.