Doorkeeper, gatekeeper, guardian of a Hindu temple.
The Hindu temple is a sacred space, a divine home for the gods when invoked by their devotees. At most temples, sculptures of deities and other figures are places on the exterior walls, in clearly defined niches or around doorways. They usually appear in pairs either side of the doorway, facing inward to protect the sacred precincts of the temple from malevolent forces. Described as minor deities, they are responsible for "keeping order" in the temple grounds, in much the same way as a sheriff or sergeant at arms. Each as has been marked with a tilak, and a purple flower is visible on top of each--signs that despite their subsidiary status, they too are objects of worship.
Dvārapālakas are to be found inside the temple too, guarding for example entrances to the main deities.
Some good accounts on the matter: https://dharmarepublic.com/dvarapala/
Pretty good descriptions are available, but reasons and ways to worship them, I cannot find.
My understanding is that the entrances are protected by mantras. If you are not getting a permission from the guards you are basically as an tourist in a museum. Asking for the permission you shall introduce yourself (name and moon sign), if you have a guru, to tell who is your guru. You shall also tell why you came to the temple.