How to completely erase iPhone 5S so it is not connected to any Apple ID?

I want to sell an IPhone 5S that I got that won't work with my carrier, but I need to completely erase it (there's nothing on it but I just need to get it off of my account totally so a new person doesn't need my personal info.)

ICloud iPhone 5 fix it