It depends (imo), on the amount of money you have left and who its from. If you've raised $1m from well-to-do-but-not-rich family members and with $500k left you're realized you're totally unqualified to be in your business, or the concept was terrible, no valid pivot, etc., then yeah, give the people back your money.
But if you've raised $1m from professional investors and you have $100k left, for example, you might be better off trying to double down or raise more money.