This is probably the commonest principle of all times. What goes around comes back around and sometimes the lesson is much harder than what you had expected. You reap what you sow quotes tell you that whatever you do in life surely gets counted. Some people call it karma and they are right because no matter how much life gets unfair sometimes, it cannot be unjust.
If you cannot change something then learn to accept it but if you cannot, try working for it instead of sitting around.