Sex??

Hi girlies! I was wondering: when is the best time to have sex to AVOID pregnancy? I know you definitely should not have sex during your fertile window, so is it safer before or after the window? I’m so confused. Like when is the ideal day or week or whatever where the risk is the lowest possible???