I am so sorry for your loss That's really devastating for you.

You can get testing. Can you talk to your OB/GYN or GP? Do you know why you lost Ryan? Most mc are chromosonal problems. If bub was tested, they can tell that. The 2nd bub would have been too small to tell. Trying again is something to think about after you've been grieving a while. Don't make that decision now. Have you had any counselling for loss?

Things that can be included in tests:
Hormone levels, such as progesterone
Immunological and blood clotting factors- there are many involved
Your and DH's chromosones. You can get karotyping, which is pricey, but will be able to tell you if you and DH have normal chromosones. Some people have balanced translocations, which means 2 of their chromosones have swapped parts, and when they mix with the other DNA during conception, they can swap incorrectly. That's a very basic, non medical explanation.
Your DH SA - his sperm morphology may be abnormal, leading to problems

I've done a lot of research since my loss and what I've found is that there's a 20% chance of a mc each time and some people are more unlucky than others. It sucks, but as all out testing came back normal, that's all I'm left with. I hope you have a sympathetic doctor who can help you.