Dedicate all actions to the Lord.
Slowly, the outside disappears and the inner takes over. Whatever happens – good or bad – it is the Lord who does it! And whatever you enjoy, think that it is the Lord who is enjoying. Gradually, one will be able to free oneself from the worldly traps and go within.
But, usually, what happens when bad things happens to us is ask “Why has God done this to us?” Anything good that happens, we like to take credit for it ourselves.