For treatment you can use medications, get a procedure, or receive IVF (in vitro fertilitzation). IVF is when an egg is fertilized somewhere not within your body. This can result in multiple children or may not work at all. IVF is very expensive and most women can't receive it for that reason.
Getting IVF can result in severe Ovarian cancer and the mother or baby can die if the treatment doesn't go right.
Some infertility cases are hereditary but most of them are not. Endometriosis is passed through genes and may be able to be fixed through a procedure. Endometriosis is a result of the appearance of endometrial tissue. Poor egg quality or low ovarian reserve are not generally considered to be hereditary causes of infertility
Most people find out they are infertile when they try to have kids or if they had a recent health problem that caused them to be infertile.