There are many reasons that a man can become sterile. At a younger age such as yours, the most common cause of male infertility is a low sperm count. A low sperm count is defined as a lack of the critical number of sperm per ejaculate that the man needs to make it statistically likely that he would be able to impregnate a woman. In the vast majority of cases, we never know why a man has a low sperm count. Because it is not known why the sperm count is low, there is little that can be done to bring it up. Most of the time, physicians recommend wearing lose fitting undergarments as one means of increasing sperm counts, but this does not work in every case.
Other causes of infertility include certain medications. The most common offenders are chemotherapy drugs. Men that unfortunately develop cancer at a young age and require chemotherapy are more likely to become sterile.
I suggest that you schedule an appointment with your primary care physician. The two of you can discuss this issue. If you have never tried to have kids, and you don’t have any risk factors for sterility, then your doctor will likely just reassure you that you should be fine. We only test sperm counts when a couple has tried and failed to get pregnant.