My old iphone keeps my settngs
Is the phone locked to iCloud? If it is then I refer you to this answer. 

Assuming no, then you will just need to wipe the phone. Assuming that you have backed up your data (music, photos etc) then open the Settings app. 

Go to General -> Reset (scroll to the bottom) -> Erase All Content and Settings -> Erase iPhone



Wait a while (it can take some time) and then the phone will be as new. It will welcome you with a "Welcome" message.



That's it!