There is an argument to be made that it is selfish to take your life when you have loved ones but also an argument that it is selfish for the loved ones to deny someone the ability to take their own life.
When you have kids it is leaning more towards being selfish to take your own life. Those kids are very dependent on you and they didn’t decide to get born. That was your decision so you have responsibility for their well being