Help - bff’s miscarriage

My best friend had a miscarriage at 5-6 weeks along. It was an accident. Never had an ultrasound. Shes very young and only with her bf for four months. I know none of this means its any less devastating. But shes devastated. I am too. I feel so sad for her. I dont know how to comfort her properly. Idk if theres something Im missing. Im several years older than her and married and I have a 13 month old and we are TTC . Im really worried about how to tell her Im pregnant when that day comes. So This is two things - how should I help and comfort her.. and how do I handle telling her Im pregnant?