What do I do before selling my 3Gs?

I am an Android guy, but was given a pair of 3Gs iPhones in trade for some work I did. What do I need todo to the phones prior to selling them to make sure all data is removed and no trace of previous owner is on it? Also should I remove sim before selling?

Thanks!
I will remove all the data on that phone before I sell it,Including format the phone. But I may keep the SIM card.
Don't worry about the sims. They should already be deactivated, and if the buyer wants to use it like an iPod, keeping the sim in it may help them activate after a firmware update. No reason to make life any harder for them.

Original thread: https://forums.imore.com/threads/what-do-i-do-before-selling-my-3gs.230663/