2 phones using same Apple ID. What happens if I erase everything on one phone?
Apple give fairly detailed instructions on how to prepare an iOS device for another person here...

https://support.apple.com/en-gb/HT201351

Basically, back it up, sign out of your iCloud account (and the App Store depending on the version of iOS you have installed) and then choose "Erase All Content and Settings".

Selecting "Erase All Content and Settings" on one phone will only affect that phone. It doesn't affect the content you have saved to another phone or the data in your iCloud account.