كَمَا أَرْسَلْنَا إِلَى فِرْعَوْنَ رَسُولًا فَعَصَى فِرْعَوْنُ الرَّسُولَ
Just as We sent a messenger to Pharaoh, and Pharaoh disobeyed the messenger.
The first occurrence «رسولًا» introduces a messenger. The later definite form «الرسول» points back to that already-mentioned individual rather than introducing another person.
This is anaphoric or previously mentioned definiteness. The article ties the second mention to the first and maintains referential continuity.