Yes, your phone will need to be unlocked before you can bring your phone to a new carrier. A locked device is restricted to your current provider, so it won’t connect properly to another network until it’s unlocked.
If your phone is already unlocked, you can typically bring it to a new network right away. If it's locked, you'll need to follow your current carrier's unlocking process first.