Prevention of pregnancy

When do u know is the right time to have sex ? To not get pregnant ? Does checking your menstrual cycle will help to prevent it ???🤔