Warren Buffett and Bill Gates created The Giving Pledge, a legally binding agreement to give at least half of their wealth to philanthropy by death or through last will and testament. It currently has over 240 signatures from over 30 countries.
Bill Gates donates to companies that benefit his existing stock investments.
https://www.thenation.com/article/society/bill-gates-foundation-philanthropy/