The problem is that sometimes, no matter how we pray or try to persevere with God, people will still die of cancer, people will still get taken from us, and we will have to live with things we have no control over.
It is better to go to a house of mourning than to go to a house of feasting, because that is the end of every man, and the living takes it to heart. Sorrow is better than laughter, for when a face is sad a heart may be happy. The mind of the wise is in the house of mourning, while the mind of fools is in the house of pleasure. (Eccl. 7:2-4, NASB)
I'd rather have a sad truth than a happy lie.
Not everyone will survive going through cancer, or whatever disease. This life is guaranteed to bring us both pleasure AND sadness. God bottles up each one of our tears, and will return them to us as tears of joy one day soon.
We can't all be happy all the time, and we can't all be sad all the time. People smile at a newborn baby, while others shed tears at the funeral of a loved one. Life goes on and so must we.
The verses you gave here, look at them like this: "It is better to go to a house of mourning than to go to a house of feasting". This could mean that even though you're happy, you could go cheer up or comfort someone who is sad. Too much of anything is bad, and that's what the "because that is the end of every man and the living take it to heart" means. Look at celebrities, they have mansions and cars and money. But it doesn't bring them true happiness, only God can deliver that. And when the money runs out, guess what happens? The mansions get sold into foreclosure and the cars get auctioned off and the celebs end up with nothing, and they mourn their unimportant losses.
"Sorrow is better than laughter, for when a face is sad, a heart may be happy." You could liken this to someone who has just lose a loved one to an accident, and that victim is an organ donor. Enter a patient who desperately needs one of those organs. The family of the deceased and the family of the patient, are both mourning, BUT the family of the victim agrees to the organ donation, and the transplant works, then both families rejoice that one person is alive, because of another person's selfless sacrifice to donate their organs. Thus, they have joy in the midst of sorrow.
"The mind of the wise is in the house of mourning, while the mind of fools is in the house of pleasure." You could liken this to someone wise being smart enough to assess a less fortunate person's situation and offer help, rather than standing far off and watch them suffer with nothing while you have an abundance of everything.
Do you see the point and lesson I'm trying to teach you in these scenarios? Take action, make a difference, don't sit on your butt like a useless bump on a log.. Do good things for others and good things will be returned to you. God promises that.