Sex talk?

This might have been posted before but I'm not sure. I wanted to know when is it a good time to have that "sex talk" with your kids? I have a daughter and I definitely want to have that talk with her. My mom never had the talk with me but if she did I truly think it would have avoided a lot of sexual abuse that went on in my childhood years. It's very important to me that I have that talk with my daughter becuase I want to also explain to her what to do if someone tries to touch her inappropriately. How should I bring it up? I don't want to confuse or scare her so any advice is much needed. Thanks!