If you want to heal your companion you must go to a city in which you can find a hospital. When you click on it (a hospital is open 24 hours a day) you must then select a hero and time/amount of health that you want to restore. Sometimes the process is not cheap and it can take some time. Healing more heroes can be problematic - there is a possibility that a hospital bed is taken by a random person and you must wait a while for your turn.
The second way, which is better and not that much expansive, is to use medicines from drugstores. You only have to buy smaller or bigger bottles with medicines and drink them, even if you are in a city (click on a teammate information, drag a medicine into their equipment and after that you can notice a text, displayed under their name, saying "Use" - you must click on it).
The last way is to heal during fights / pursuits. You can use a character that has Healer skill or you have a medical carriage attached to your train (you unlock it in the later parts of the game).