My four year old daughter is touching herself. How do I explain to her about touching herself.

Talk to her! You explain about touching herself by explaining about touching herself. If you are uncomfortable talking about this subject, then you have to learn to deal with it. You are going to need to discuss *many* uncomfortable subjects before your child is grown. In this case, simply pull her hands out of her pants and say "we don't touch ourselves there when people can see.".
It's OK in private. This is very common in this age group, as they explore their bodies and find out certian things 'feel good'. Now is a great time to let her know she is in charge of her body, and that she can touch herself where she wants, but others can't. Also explain that the parts of our bodies tht underwear covers are for just her to see, and so that if she wants to touch those areas we do that in our bedroom.