Immanuel Kant said this quote

[A man], who is in prosperity, while he sees that others have to contend with great wretchedness and that he could help them, thinks: What concern is it of mine? Let everyone be as happy as Heaven pleases, or as he can make himself; I will take nothing from him nor even envy him, only I do not wish to contribute anything to his welfare or to his assistance in distress! Now no doubt, if such a mode of thinking were a universal law, the human race might very well subsist, and doubtless even better than in a state in which everyone talks of sympathy and good-will, or even takes care occasionally to put it into practice, but, on the other side, also cheats when he can, betrays the rights of men, or otherwise violates them. But although it is possible that a universal law of nature might exist in accordance with that maxim, it is impossible to will that such a principle should have the universal validity of a law of nature. For a will which resolved this would contradict itself, inasmuch as many cases might occur in which one would have need of the love and sympathy of others, and in which, by such a law of nature, sprung from his own will, he would deprive himself of all hope of the aid he desires.