Advice for telling hurting friends

How to you tell someone who is struggling with infertility or loss of fertility that you’re pregnant?

If you’re struggling, how would you want your close friends to tell you? In person? Over the phone? Out to dinner?

I know this is super vague but I want to protect our friend’s privacy while trying to get suggestions for spilling the beans.