To change wireless carriers, your phone must first be unlocked by your current carrier. If you have not done this, you will need to contact your current carrier and ask them to unlock the phone.
There are requirements for unlocking, so your current carrier will advise you if your phone is eligible for unlocking. The carrier will often not be thrilled to unlock the phone, since they realize that they are losing a customer.
Once the phone is unlocked, you can contact the other carrier that you want to use and ask them to set up service on your phone.
While it would always be a good idea to back up your phone before you make any changes to the phone.....just in case.....you will not normally lose any data on the phone simply by changing carriers.