How to factory reset iphone but keep information?

My iphone 4s has been having some issues and i need to factory reset it but i want to keep all my information so what should be done?

P.S. Do i lose my phone number and all that if i factory reset?

You can make a backup on your pc and then restore it and then you can go back to it and download the backup you made.
Restoring does not delete your phone number
Just data like photos and apps etc… Like you get it when you buy it from a shop.