I'm not sure if you are removing it to sell it? Go to settings general and reset. Reset all content and settings and the person who bought it sets it up as new. If you bought it the other person needs to do what I just described. Good luck
You can also go into iTunes and manage which devices your Apple ID is associated with. Even if you erase all contents and settings, which does keep the new owner from using your info, the Apple ID could still be technically associated with that device.