The gin and tonic was invented in the 1700s by British forces stationed in India. They used tonic water to treat malaria, but it tasted so bitter that they had to mix it with gin and lime to make it drinkable.
Note that the tonic water we drink for “refreshment” today has a medically insignificant amount of quinine. You would have to drink six liters of it every day to see any result. Not only that, but most tonic water doesn’t even have any quinine. And, although quinine has been found to briefly suppress malaria, the amount needed to do so long-term would cause more problems than it would solve.