The 25 pauri of Japji Sahib explains that even bad things are gifts from Waheguru. The pauri ends by saying "Just let me be a sacrifice to you. Because the only good that is done is that which pleases you".
The whole world plays out in the will of Waheguru. All the bad stuff that happens here is karma. This earth is where we work through our karmas. There is no other place to do it.
So how can God be pleased? The basic nature of the Infinite is to nourish, sustain, and support. So when you act in the same way, then you become part of this process, and you become like God. That's why we give dasvandh; God gives, so we give. Our true nature is to live in divinity and be God-like. So give up thoughts of yourself, and don't worry about your predicament in life, let go, and live in the Hukam of Waheguru which is creating and sustaining all in every moment.