Paul is telling Timothy to use wine as medicine. The water in that area often caused sickness.
"to help your stomach and to stop your frequent illnesses"