Trying for rainbow baby

How long after a miscarriage did people try for another baby? I’m worried it will happen again😞