Pathogens (germs) can be transmitted very easily when injecting heroin or other drugs. This includes HIV and hepatitis viruses, which lead to serious liver inflammation. Injecting drugs can also cause abscesses and vein inflammation.
You can protect yourself from infections when using drugs by only ever using your own syringe and equipment. It's generally less risky to snort or smoke drugs than it is to inject them.
But snorting (inhaling) also carries a risk of infection. Therefore you should never share a snorting tube with other people.
In general, you should try to ensure the most hygienic possible conditions for drug use. This will reduce the risk of infection with viruses, bacteria and fungi.
Using only your own needle and consuming drugs in the most hygienic conditions possible is called "safer use".