I am not sure why there are so many problems in my life or in other peoples' lives. Mainly I think the problems come from sin. But it helps to know which sin so that one can repent. So what I do is to try to think back in my life to see exactly what were my sins so as to know what to repent on. That approach can help others also.
That is to say,-- that when you see things not going well, you ought to think back in your life to try to discover what exact sins triggered the problems.
I can do this fairly well in my life. I can recognize not listening to my parents, leaving the Land of Israel, leaving the good advice of Rav Nahman, and also pushing off a kind of state of inspiration. But clearly others have all kinds of other sorts of sin. And I think that with a little thought most people can discern what sins they need to repent on. But I am not saying that these are my major sins. Also I am not saying that one can easily discover what their major sins are. Rather I think that if you repent on the things you know you need to repent on, then (in that merit) I believe God reveals to one what further sins he or she needs to repent. on.
[What do I say that problems come from sin? Because in the Musar book Shaarie Teshuva [Gates of Repentance] of R. Yona, he brings from the Gemara that אין ייסורים בלי עוון ("There are no troubles without sin.")