Scared of miscarriages

Im ttc but today my friend had her baby 10 weeks early then later i find out that my boyfriends sister in law lost her baby that was due in july. This is making me nervous about ttc i dont wanna go through that. How many have yu guys have had misscariges what caused them?