Pregnancy testing

How do u determine when to take a pregnancy test when you have irregular periods and dont know if u ovulated or when u did ovulate ? Its confusing but any help ?