As I understand it, the theological response is that God gave man freewill, and although a loving God has a plan for each of us, that God also gave us the freedom to make choices.
Just as Adam and Eve had the freedom to commit the original Sin in the Garden of Eden, we also have freedom to make our own choices against the will of God
If one dedicates one's life to God, then one trusts in the ultimate benevolence of God and will continue to struggle against the trials and pain that the loving God has assigned to us, all the time rejoicing that one's God knows better then we mere mortals. Further, the believer is confident that he/she continues to carry out God's will, through their suffering here on earth. They know their dedication will surely be rewarded in Heaven.
Those who choose not to so dedicate their lives to such a loving, benevolent God have the freedom of choice to end their lives.
Within the Catholic Church, suicide is seen as a mortal sin and will commit the sinner to an eternity in purgatory, or even Hell.
Other church orthodoxies take a slightly softer lines on this.
For atheists, it is not a problem - if it seems that life is so painful, then there is the choice to end that life and end the suffering.
As to worms that eat their way into a human eyeball, that, also is part of God's will for the world. Who (apart from the loving, benevolent God) is to say that the child will not discover great things through their blindness, or that the worm will reproduce and go on to do good into the future?
The point is that good, rational and entirely justifiable questions such as these are answered by the faithful with some variant of:
"Trust in God. He truly knows what is best for you and for everyone else on earth. It is not our place to question why. Just believe, have faith and you will be rewarded in Heaven"
As I said, I only repeat the theology as I understand it.