There is Khayr in everything, but only if you look with imaan. The rain doesn't ruin your plans, it gives you a chance to make more dua. You lost something beloved to you because Allah heard things you didn't hear. You can't fall asleep because Allah wants you to talk to him