The gemara in berachos 5a discusses a person who has yesurin (suffering) and says he should investigate his actions:
...אמר רבא ואיתימא רב חסדא אם רואה אדם שיסורין באין עליו יפשפש במעשיו
...פשפש ולא מצא יתלה בביטול תורה
It says if he "doesn't find anything" he should assume it is because of bittul Torah. Rashi on "doesn't find anything" says
לא מצא עבירה בידו שבשבילה ראוין יסורין הללו לבא
"he doesn't find any sin for which this (emphasis mine) suffering should have come." The gemara indicates that the proper response to suffering is introspection into ones actions, and, evidently, one can figure out what sins he did to cause a certain suffering.
There is a famous story (famous because I have heard it) about R' Isar Zalman Meltzer that goes as follows:
A man came to visit R' Meltzer. While they were talking, a noise came from the kitchen and R' Meltzer's wife cried out. He ran into the kitchen, there was some quiet discussion, and then they both left the house, leaving this man waiting. When he came back, he said "where were we" but the man asked for an explanation of what had happened. R' Meltzer told him that a pot of milk in the kitchen had boiled over and spilled. He and his wife had a discussion to figure out why such a thing would happen, and then she realized that they had not paid the milkman. They ran out to find the milkman, and when they paid him, he informed them that he had not known how he was going to buy food for dinner that night.
It doesn't always work out that smoothly, but at least R' Isar Zalman Meltzer felt it was worthwhile to try to figure it out.