If the device is carrier-locked, you need the carrier that issued the phone to unlock it for use with other networks. Also, you need to be sure that the specific networks being used are fully supported by the phone (not all models support all networks).
There are 3rd party (paid) services that offer to give you an unlock code/method, but that's not guaranteed (nor something we do in this site). Additionally, check if the phone doesn't need to be region-activated too (Samsung has been known to only activate phones meant to be sold at a certain region if the first call is placed on a carrier from that region, hence, deterring grey market imports).