Unfortunately, there is no specific time during a pregnancy when it is not possible to lose the baby. Strictly speaking, the loss of a pregnancy before 20 weeks is considered a miscarriage, and pregnancies lost after this time period are called stillbirths. You are correct in that miscarriages occur much more commonly when the pregnancy is very young. The vast majority of them happen between 5 and 10 weeks of pregnancy. Some of the happen so early that women mistake them for a period that is a couple weeks late and never know that they were pregnant. While we rarely find out why a specific miscarriage happened, most of the time they occur when there is an abnormality in the baby's genes.
If you are thinking about trying to get pregnant, then you should schedule an appointment with your OBGYN for a pre-pregnancy consultation session. There, the two of you can discuss issues that are pertinent to having a healthy pregnancy. Many of these issues are important in the first few weeks of pregnancy. Your doctor
will likely want to give you a prescription for a prenatal vitamin that will provide your body with extra nutrients important for the baby's first few weeks.