Ask them about it? Something is clearly going on and if it's someone close you should try to act concerned about them and their life. A lot of people tend to ramble their complaints because they know no one listens but they need to get it out so having to consciously describe the problem might give them insight on what's actually wrong.
Try to propose a solution or who to go to. (I'm not saying "solve their problem" because they'll come up to you next time they have one, but if you can try to lead them to some options).
Lastly, you can always end with "you need to get your shit together" (works for some people), because we're all responsible for our problems and whether we'll show it to other people (includes negatively affecting others) and know when to use breaks, seek help etc.
P.S. Don't give them false hope that you'll be there for them if you (don't know you) can't.