Summarize this article:

Contact the carrier you want to switch to for a new SIM card. Shut down your phone as you normally would. Depending on which Android model you're using, the SIM card will be in a slot on the side of the case or under the back cover (sometimes under the battery). Insert the SIM card from your new carrier into the slot. Instead of your normal home screen, you'll get a notification that your phone needs to be unlocked before it can use the installed SIM card. Use the keypad to type in the code you got from the Straight Talk representative. Press UNLOCK. You'll see a confirmation message confirming that the code has been accepted. Now you can use your Android phone with your new carrier.
Get a SIM card. Power off the phone. Remove the Straight Talk SIM card. Replace the SIM card. Power on your phone. Enter the unlock code.