Valmiki Ramayana Kishkindha Kanda Sarga 24 Shloka 42
Original Shlokaमा वीरभार्ये विमतिं कुरुष्व लोको हि सर्वो विहितो विधात्रा। तं चैव सर्वं सुखदुःखयोगं लोकोऽब्रवीत्तेन कृतं विधात्रा।।4.24.42।।
1 source checked for this shloka
वीरभार्ये O wife of a valiant one, विमतिम् disconsolate thought, माकुरुष्व not entertain, सर्वः all, लोकः worlds, विधात्रा by the creator, विहितः हि is fixed, सर्वम् all, तम् such, सुखदुःखयोगं चैव state of happiness and sorrow also, तेन विधात्रा by that creator, कृतम् done, लोकः people, अब्रवीत् have maintained.
'O wife of a valiant warrior Do not lose heart. The entire world is controlled by the creator. People maintain that joy and sorrow are foreordained.