A vaccine is not 100% effective against typhoid fever. You can prevent typhoid fever by drinking bottled water, avoiding raw fruits and vegetables and washing your hands often. These safe practices give you a better chance of staying healthy.