SB 4.8.33

yasya yad daiva-vihitaṁ
 sa tena sukha-duḥkhayoḥ
ātmānaṁ toṣayan dehī
 tamasaḥ pāram ṛcchati
Word for word: 
yasya — anyone; yat — that which; daiva — by destiny; vihitam — destined; saḥ — such a person; tena — by that; sukha-duḥkhayoḥ — happiness or distress; ātmānam — one’s self; toṣayan — being satisfied; dehī — an embodied soul; tamasaḥ — of the darkness; pāram — to the other side; ṛcchati — crosses.
Translation: 
One should try to keep himself satisfied in any condition of life — whether distress or happiness — which is offered by the supreme will. A person who endures in this way is able to cross over the darkness of nescience very easily.
Purport: 

Material existence consists of pious and impious fruitive activities. As long as one is engaged in any kind of activity other than devotional service, it will result in the happiness and distress of this material world. When we enjoy life in so-called material happiness, it is to be understood that we are diminishing the resultant actions of our pious activities. And when we are put into suffering, it is to be understood that we are diminishing the resultant actions of our impious activities. Instead of being attached to the circumstantial happiness and distress resulting from pious or impious activities, if we want to get out of the clutches of this nescience, then whatever position we are put in by the will of the Lord we should accept. Thus if we simply surrender unto the Supreme Personality of Godhead, we shall get out of the clutches of this material existence.