Lankini was mentioned in the Ramayana, and she was the Devata of Sri Lanka, and she was also called as Lanka Devi and Lanka Mata. She served as a guard in Sri Lanka during the Treta Yuga.
As per legend, once Lankini was serving as a guard in the Brahma Loka, also known as Satya Loka. Due to her good position, she got pride, and disrespected the Devas and Rishis like Daksha Prajapati, SanguKarna and Narada in the Brahma Loka. Due to her bad acts, she was cursed by Lord Brahma to guard the city of Srilanka. Since Lankini realized her mistake and asked Brahma to forgive her sins, Brahma had granted the boon, that when she was slapped by a mighty Vanara, she would be relieved from her curse. Similarly, when Hanuman visited the Lanka kingdom in search of Mata Sita, Lankini didn’t permit him to enter into Lanka. Due to that, she was slapped by Lord Hanuman, and as a result, she was relieved from her curse, and thanked Hanuman, and went to the abode of Lord Brahma, the beautiful Brahma Loka.
In the previous yugas, whenever a powerful rishi, king, god or goddess curses anyone, it would immediately affect them, and they would have to bear the curse for a certain period of time. Even the Dwarapalakas of Lord Vishnu suffered from the curse, and as a result, they took births as demons in the three yugas, and finally reached the abode of Lord Vishnu, the Vaikunta during the end of the Dwapara Yuga.
Residing in the divine lokas is also depends on the grace of the almighty. If a holy man residing in the Divine Lokagets pride, and if he didn’t respect others in that divine world, he would be immediately thrown out from that loka by the almighty, and then he has to take numerous births in the earth and would have to suffer a lot.
Hence let us always fill up good thoughts in our mind, do good things to others, always move with others in a kind manner, worship the almighty sincerely, and be blessed.