You seem to have many issues, but some are primary, others secondary, and even a couple of tertiary ones, like failing your grades.
I don't think you now have the time to solve your primary causes, so if I was you I would concentrate on the secondary, and that is a complete lack of self-discipline. To me, the best way to address this is either to create or join a study group, so that even when your willpower goes south, peer pressure keeps you on track, or then to drop out of the classical education style and go to a form of education where you are closely supervised by a mentor.
Once you get enough working habits, some of your self-confidence will return, and you will be able to rebuild yourself and tackle the primary causes.
In brief: don't panic, get help.