Śrīmad-Bhāgavatam · Text 4.23.11
Who is speaking and story frame
तस्यानया भगवत: परिकर्मशुद्ध
सत्त्वात्मनस्तदनुसंस्मरणानुपूर्त्या ।
ज्ञानं विरक्तिमदभून्निशितेन येन
चिच्छेद संशयपदं निजजीवकोशम् ॥ ११ ॥
tasyānayā bhagavataḥ parikarma-śuddha-
sattvātmanas tad-anusaṁsmaraṇānupūrtyā
jñānaṁ viraktimad abhūn niśitena yena
ciccheda saṁśaya-padaṁ nija-jīva-kośam
By regularly discharging devotional service, Pṛthu Mahārāja became transcendental in mind and could therefore constantly think of the lotus feet of the Lord. Because of this, he became completely detached and attained perfect knowledge by which he could transcend all doubt. Thus he was freed from the clutches of false ego and the material conception of life.
Read Śrīla Prabhupāda's purport on Vedabase.io