If you find yourself trying to figure out why bad things are happening to you, take a look at your drinking, drug, gambling, spending, internet, eating and other habits and ask yourself if any could be contributing to your problems. If you can answer yes or maybe, see an addictions counselor for an assessment or renew your recovery program. Don't question or doubt that you have a problem, just get into the solution that is suggested to you.
If you are just feeling bad, and you are trying to stay serene and sober, remembering the terrible consequences that you had when you were using may make you feel gratitude and therefore better now that you are clean and sober. Also, life contains suffering regardless of how well you are working your recovery program. Friends die, family gets sick, you will make painful mstakes, etc. It's all part of life. However, you don't have to make things worse. If you practice good spiritual principles (like,love, honesty, service, forgiveness, etc.) you will thrive during hardship.
Write down each time bad things have happened to you. Was alcohol, drugs or other behaviors at all related? If times are tough and you are sober, use spiritual principles to survive and thrive.