Stop comparing your life to others, and stop thinking of life in a success or fail window. All you should be concerned about is being happy, for all you know those very same people you look at and think are doing well could be miserable even with all their success.
Get yourself into a routine, even if it's something like going to the gym 4 days a week. Develop a pattern somewhere to help yourself, I suggest the gym because it gives you an attainable goal, a pattern and it helps get you into the mindset of working hard. Try volunteering, not to make yourself feel better but so you can help others who may feel the same way as you. You're alive and not in prison for life, so your life can be "fixed".