It may be a situation that you need to see a practitioner to identify exactly what is going on.
A chiropractic adjustment to your hip positioning may be needed.
Identifying the reason why pelvis position gets rotated will help resolve the issue so it doesn’t keep showing up.

Seeing a practitioner will identify what the popping sound is too.