How do I erase an IPhone but not off the cloud?

My phone broke and now I'm using my mom's old phone but all of her stuff is still on it. How do I erase her phone without erasing things off of her icloud so that her current phone still works. I'm going to use my SIM card.

Log out and then erase it.

Go to settings, then tap your name, scroll down, tap sign out.

Erasing the phone will not affect her iCloud stuff or other phone. All it does is make the phone forget.

Settings>General>Reset>Erase All Content and Settings.

You will need the phone security credentials to do this. It erases only the phone data: anything saved to your mum's iCloud account stays there.

As not everything has necessarily been saved to iCloud, perform a full backup of the iPhone to iTunes on a host computer before resetting it.