i wanna have sex

I wanna have sex but I don't wanna get pregnant. what should I use to prevent pregnancy? when is it a good time to have sex without the risk of pregnancy? I wanna have sex the day before my period is that safe? please help need advice