Some tips to help prevent pneumonia include getting vaccinated against pneumonia and the flu, washing hands frequently, avoiding contact with sick people, not smoking, managing chronic conditions, wearing a mask if working in healthcare, and eating a healthy diet to boost immunity. Getting plenty of rest and fluids when you feel ill can also help prevent secondary infections.