You cannot escape having to go through obstacles and troubles. That is the way of life; it is painful. The greatest saints have suffered, and suffered with a smile for God. There are many persons who have never suffered sickness and at the time of death have just fallen asleep without any difficulty. But that does not mean they are yogis, united to God. Lots of animals have also lived and died without suffering. The equanimity of yoga is when your love rises above all obstacles that God has put before you. In that transcendence you find Him.
As one great saint of India used to pray: “Come to me as a touch of pain, for in pain I urgently remember Thee. If I should ever forget Thee, in the thickets of joyous tears touch me with the finger of pain to wake me from that forgetfulness.” So pain was given not as a cruelty or to destroy us, but as an awakening, reminder that we must reach the Immutable One where all pain ceases.
Anything that causes pain and suffering should be avoided if possible. But when it does come, unless you are able to endure without embitterment and despair, you cannot reach the kingdom of God. Look at Jesus Christ on the cross. Consciously he had to go through the dreadful sensations of pain until he had overcome the flesh. When he lifted his consciousness to God-awareness, he realized instantly that it is all a delusion; and then the arms of the Father enfolded him. This whole drama is between pain and love. Your love must be greater than your pain. From the teachings of P. Yogananda