Pregnancy Testing

What is the earliest you can take a pregnancy test? I know it’s best to take one the day or two after a missed period.

Is it possible to get accurate results 3-4 days before your period?