One verse

Srimad Bhagavatam 6.2.41

6.2.41

ततो गुणेभ्य आत्मानं वियुज्यात्मसमाधिना । युयुजे भगवद्धाम्नि ब्रह्मण्यनुभवात्मनि ॥ ४१ ॥

tato gunebhya atmanam viyujyatma-samadhina yuyuje bhagavad-dhamni brahmany anubhavatmani

tatah
thereafter
gunebhyah
from the modes of material nature
atmanam
the mind
viyujya
detaching
atma-samadhina
by being fully engaged in devotional service
yuyuje
engaged
bhagavat-dhamni
in the form of the Lord
brahmani
which is Parabrahman (not idol worship)
anubhava-atmani
which is always thought of (beginning from the lotus feet and gradually progressing upward).

Ajamila fully engaged in devotional service. Thus he detached his mind from the process of sense gratification and became fully absorbed in thinking of the form of the Lord.