how to prevent getting sick?

I’m 22 weeks pregnant and my sister just got out of the hospital. She was in a psych unit but now she’s out and I gave her a hug. now, not even 2 hours later, she’s gotten sick and has a fever. I don’t know what she’s sick with but I don’t want to catch it and get sick I don’t want anything to happen to my baby. is there a way to prevent getting sick before it happens? Sorry I’m a FTM and paranoid and I was sick a few weeks ago with a fever