there is a poverb which goes like : a friend in need is a firend indeed. when a friend of yours gets into trouble, what you are supposed to do is to comfort him or her and most importantly to offer some advice to get him or her our of the trouble, even thought this friend of yours doesn't come to you and ask for help. to be always there for him or her, that is what friends are for. if something is bothering my friend and makes him or her sad, i would try to tactfully ask him or her what the problem is , and try to be understanding and not to judge him or her. then i would give some advice if it is needed. and say something to comfort him or her such as accidents happen, it's not your fault, every cloud has its silver lining and etc. these might sound cliche, but conbined with the analysis of the situation, these words would surely make some sense to the friend and make him or her feel better.