First and foremost, this is a matter of opinion to wear underwear with leggings and yoga pants.
Some women wear the cheap cotton thong or G-string type underwear under their yoga pants because they are worried about visible panty lines. Some rather not, as it frees them to do any body movements with no restrictions.
I say, comfort should be paramount.
Just wear what you are comfortable in as working out in. Being uncomfortable is the last thing you want to be worrying about whilst working out, I mean is it supposed to be a serious workout session, or a fashion show?
If you rather to go with wearing underwear, I don’t think there is a particular style of what would be the best to wear with yoga pants or event with yoga shorts. Again, wear whatever is comfortable. Preferably moisture wicking and stretchy too.
The only thing that might happen is it might show some pantylines. As for me, I don’t care about that; if someone sees my pantyline or catches a peek at the Victoria’s Secret logo on the waistband of my underwear.
For those who would rather not, make sure the pants are not see through specifically in the gusset crotch when stretch it. Also having some additional layer in that area might be helpful yet not really necessary.
Wearing underwear or not, it is a great idea is to promptly change wet laggings and undergarment after the session to avoid irritation caused by sweat and rubbing on your skin.
Remember that it’s a workout session, make it work the best for you.