Always ask your carrier first. If you buy an unlock code and the first entry fails try just one more time. Some codes are not reliable. My experience has always been good but all codes come from commercial unlockers recognized in the forums here. Too many failed entries and the phone may need service.
Bits--C000C6078 for links to world news and views, technology and science postings.
If they give these codes out for free, then it's a no brainer--go with the carrier.
There are a lot of reputable third party unlockers that offer a money back guarantee. So if you have to pay, then you might as well go with the cheaper option, and if that's a third party unlocker, make sure you pick a good one.