RH- and pregnancy

Ka

Hey girls! So I’m RH- and have had a miscarriage because of that.. I’m currently trying to get pregnant. Should I go in and get the RhoGAM shot before I get pregnant or wait until I know for sure that I am?