Ovulation tests!

Can anyone tell me how the ovulation tests work? Like how do you know when to take one? I have no idea at all but a lot of people on here seem to have used them? 
Thank you :)!