After having a miscarriage you should wait at least 6 months before trying to have another baby.
If you wait 6 months after the miscarriage for trying to have another baby you have a better chance at actually having the baby and not having another miscarriage.
Some doctors advise that you can try within a week or so after a miscarriage for trying to have another baby and they say that you're more fertile soon after a miscarriage and will likely have less complications during pregnancy.
So you don't have to wait 3 to 6 months after miscarriage before trying to get pregnant again but it's usually better to wait.