How to unlock my iPhone 4 from Verizon or sprint?

I just got an iPhone 4 or 4s off my friend for free but I noticed the phone doesn't have a SIM card slot on the side of the phone, I Read that it's carrier is locked to only work for sprint or Verizon cause they don't use SIM cards. So how do I unlock this phone from home instead of going to t mobile to unlock it?

You can't unlock a phone like that.unlocking it is breaking the law.

Verizon & Sprint phones are cdma, t-mobile is gsm, you can never use a cdma phone on t-mobile.

Also, only gsm phones can be "unlocked".