The Chofetz Chaim, Rav Yisrael Meir Kagan, once stopped by a pharmacy and told the pharmacist how much he envied him. The man was taken aback, and asked what there was to envy?
The Chofetz Chaim explained he envied the pharmacist because of his many opportunities in the course of each day to sell medicines and save lives.
The pharmacist responded that he merely did it to make a living, not out of any other motives.
Hearing that, the Chofetz Chaim said to him, “When you come to work, you must have the intention that ‘I am coming to fulfill a Mitzvah of Chesed to others and saving lives.’ The profit-making side of it does not devalue the Mitzvah, as long as you have the proper intention!”
The pharmacist followed the Chofetz Chaim's advice, and over time, the pharmacist, who until then had been somewhat distant from his faith, became fully observant, and eventually, he rose to become the head of the Chesed organizations in his city! (Kuntres Chaim V'Chesed)