When's the best time to take a pregnancy test?

My husband and I haven't really been trying to conceive but tried at the same time. If that makes any sense. I'm starting to have syptoms of pregnancy but I'm not sure when the best time is to take a test. We did get pregnant a few months ago and all the pee tests said negative and then got rushed to the er and found out I was pregnant. But unfortunately miscarried. Is it best to wait after your missed period or can I take one now? Or just go straight to the doctors and do a test there?