Plan your trip well in advance and take all the precautionary medical measures. For example, do not take the trip without having all the necessary vaccination done. Some countries have mandatory for travelers to give them proof of certain vaccinations done at the time of arrival in their country.
Read if the country you are going to visit has any particular health danger. For example, spread of any virus or infection. In some countries mosquito bites can cause many problems such as fever and if you have the information beforehand this can protect you against those dangers.
Typhoid is generally caused by eating unhealthy and unsafe food and you can protect yourself from the disease while eating safe and healthy food. Also, drink pure water. If you do not have access to bottled or mineral water in the country you are visiting, try to drink boiled water. Drinking unsafe water is really dangerous to your health.
In case the risk level is higher in a country you can carry vaccination or other medicine with you and try to take it every week. This will help you fight the danger off and you can be protected against any virus attack. It is a must that you keep your immune system strong as otherwise you are likely to be infected with the typhoid virus.
If you feel you have caught fever, see a local doctor immediately. In case you delay consulting a doctor, it can quickly affect your immune system and your ability to fight off the disease will be very low. This can add to your problem and you can even suffer other illnesses such as depression etc.
In spite of taking all the protective measures and getting timely treatment against typhoid, if you feel low and find it very hard to recover, it is better you should return home. The sense of alienation and depression can aggravate problems for you and you find it difficult to get fit to continue your trip. At home, you may have some family support and it will help you in quick recovery.
Also, if you have a high risk of any particular virus for any reason, try to avoid traveling to the country or region where the danger level is high. You are most likely to get sick quickly in the countries that do not offer quality health, food and drinking products and services.