The problems we are given are never random. Each is meant to teach us something. It may be gratitude, patience, or any important virtue missing from our life. Whatever it may be is for our good. We must believe that.
This Hadith is proof that having good intentions towards people never goes to waste. You remember someone in a pure act of worship, and the angels remember you in theirs.