Ovulation Confused

How does ovulation work I am so confused people tell me to have sex with my boyfriend when I'm fertile. Then others tell me have sex when I'm ovulating but I don't know when I am. Can some one with experience help figure this out?