Pregnacy test

Fa
How soon can you take a pregnacy test??will it be accurate if done before missed period??