Yeast infection

How do I know if I have one? And do you have to be sexually active to get one?