How do you tell someone their underwear is showing?

Yes, I have tried to say it upfron but then I get asked "Well, ¿why were you looking?"
No, I wasn't looking, my gaze just passed over your butt accidentally, sorry.
How do you tell someone their underwear is showing?
Post Opinion