When is the perfect time to test?

I know this is probably asked soo much but when is the perfect time to take a pregnancy test to get the right result?