I’m a little confused

When is the best time to have sex, since I’m not trying to get pregnant? Ovulation occurs before your period starts like cramping discharge and everything? However I experience this after my period ended about a few days after?