This is the hardest part. If you don't remember which carrier originally locked the phone, look for a logo on the phone's casing or boot screen. Common codes:
This guide covers how to use online calculators to generate network unlock codes (NCK) for legacy Nokia DCT4 nokia dct4 calculator online