In his 2003 book, How to Practise, the Dalai Lama describes many useful tools for working toward enlightenment. One is a meditation he performs every day, and since reading the book, so have I.
First, use mindfulness meditation to reach a place of peace.
Second, imagine “selfish me.” This is yourself, who wants something. That wish is allowed, supported and treated as entirely reasonable, whatever it is.
Third, on your other side, imagine any person or group that will be negatively impacted if the wish is granted.
Let’s go extreme, and suppose your wish is suicide: to escape all your problems by killing yourself. When you look for people who’ll suffer if you do that, you’ll be surprised at their number. Even if you are a completely isolated homeless person, someone will find your body, and will probably become traumatised. Various people will need to deal with the consequences. There may be social workers who feel their failure every time one of the group they wish to benefit dies.
Fourth, balance the two sides. Invariably, His Holiness writes, while “selfish me” is accepted and even loved, he chooses to back down in order to avoid harm to others.
Looking at long term consequences of our actions is one of the requirements of Buddhist philosophy, and this meditation ensures that you do.