When is the safest time to have sex?

I don't want to get pregnant but, I don't take any pills or contraception so I'd like to know when is the safest time to do so. Is it safe to have sex when you just had your period? or when your period is gone? or before your have your period? Or what part of the cycle as what I can see on eve is safe for having sex. Someone please educate me. I'd gladly appreciate it.