There are good ways and bad ways to give to charities. It often depends on the charity.
People often decide to leave some or all of their assets to charity. However, the best way to find out how to give to any specific charity is to talk to that charity, according to Mountain Xpress in "Local nonprofits work with donors for planned giving."
Many charities have specific language they like donors to use, when giving gifts in their wills or trusts. This helps the charity know how they can use the gifts legally. Donors can also benefit from this, since the charity might have different funds set up for its different charitable activities. Donors can direct that their gifts be used for the specific funds they choose to support.
Some charities even offer “benefits” now to people who promise to make a gift to the charity after they pass away. However, if you do not let the charity know about your plans, then you cannot get those benefits.
An estate planning attorney can advise you on creating an estate plan that fits your unique circumstances and may include leaving something behind for charity.
Reference: Mountain Xpress (May 12, 2018) "Local nonprofits work with donors for planned giving."