What’s the earliest day you can take a pregnancy test?

I really want to know, had a miscarriage in October