I can definitely relate to what you said, and I think sharing my journey through academia may at the very least give you some ideas in how to approach yours.

TL;DR at bottom

Lots of the usual helpful advice has been given to you already (meditation, medication, exercise, diet, lifestyle), and I don't want to discount it by any means as it's all extremely helpful to try to achieve some kind of life balance through pursuit of better habits which can definitely help you become more focused. Instead I'm going to tell you what I've learned, as I was in a similar situation 9 years ago, though whether my lot has been improved much through experience is probably open to debate.

I was diagnosed with ADD when I was 8, though I've come to feel that the broad range of symptoms that the label is applied is less of a binary trait and more of a spectrum of behavioral characteristics that everyone can relate to, some more than others. If you feel like you have it, you probably do, though getting the official seal of "ADD" is probably only useful in that it gives you a venue to legally obtain medication to help mitigate it, as I did; working my way through the pharmacopoeia until I eventually settled into a grudging partnership with Adderall, which I took throughout high school. And it WAS very useful for extended periods of focus and crunching before tests and exams.

The one catch: I absolutely hated it. It made me feel disconnected, gave me a serious case of cottonmouth, gave me some serious bad breath, and made it nearly impossible to maintain a healthy sleep habit and diet. It's not something I would recommend except as an absolute last resort.

College can be a cruel first test of one's ability to balance their commitments. Personally I found the barrage of new things I had to deal with on my own for the first time overwhelming, and didn't last long at my first institution (UIUC). At the same time, I can say that many of my obstacles were things I chose. Making friends, going to parties, getting involved with student groups, and social activities were all things that I chose over applying myself towards my coursework. And here's the thing: I learned a lot! But not about the things I was being tested on.

I don't want to ramble on with obsessive detail, but I will say that I finally graduated 9 1/2 years after enrolling in 2003, though much of that time was spent not in school. Here's what would have saved my parents and I a lot of money: As soon as my interest waned, I should have taken time off. I didn't because of family pressure. There's a poignant quote somewhere about not playing if your head's not in the game, I'm sure, and I wish I had taken heed.

The thing is, all the time spent partying, travelling, working crappy minimum wage jobs, and living outside of the the very small world that concerns itself with minute improvements to the travelling salesman problem, and whether P = NP, gave me a perspective that has finally motivated me to pursue a self-driven education on computer-science-related topics that I never had until my very last semester of college (which was Fall 2012). Do I regret it? Sure, there are loads of things I'd do differently, but through the whole process I've developed extracurricular skills I value and am generally much happier and fulfilled person than I would have been if I had graduated in 2008.

So what I'm getting at in what I've realized is an extremely roundabout way, is that if you don't feel like you're really ready to dive into what you're learning headfirst, if you don't feel COMPELLED to... then don't. Take some time off and do something else that you want. Consider another major or career path. Learn to play an instrument. Heck, join a circus troupe. If you think your CS curriculum is tough now, just wait until your junior and senior years. That's when the difficulty really starts to adopt a tune that has the palatability of nails-on-a-chalkboard.

Because of pressure from my parents mainly, I kept going back when I knew with all the fabric of my essence that I wasn't ready and trying to half-ass my way through my classes. And I kept getting chewed up and spat out so to speak by the difficulty of the material. Seriously, I ended up failing core computer science classes repeatedly because my head wasn't in the game, because I didn't understand why the concepts I was learning were important, or applicable to anything I was interested in doing at the time, and because I truly just wasn't ready. It's like trying to bike up a steep hill without enough forward momentum. You need to be in high gear and ready to bring it.

So what finally got me interested in learning the material? I've always been fairly certain that I want to build things with code. I considered everything from music to writing to psychology in throes of self-doubt, but what it came down to in the end was that nothing excites me the way computer technology does, which fortuitously enough happened to be my intended major from the get-go. But I had to learn a lot about everything else the other academic disciplines, and life in general, had to offer before I was comfortable making that decision.

TL;DR, as promised:

-Unless you want to medicate yourself (which may be unhealthy in the long run), you may have to put higher ed on hold until you're feeling it (I should have).

-The degree isn't as important as the knowledge. Motivate yourself to learn things that you're interested in for now. As your base of knowledge grows, you may find that more and more of your interests overlap with a computer science curriculum. In that case, go for the degree again. If not, consider majoring in or studying something else.

-Consider taking some time off from any kind of classical academic learning and instead use this time for other personal and emotional growth and self-discovery. Work and support yourself, if you're not already. Go on an enormous road trip. Spend some time volunteering for a cause that resonates with you.

-If you do decide to continue with school full-time, then do whatever you can to make it your only commitment. Tell the band they have to find a new drummer. Tell your best friend to find a new wingman. Move in with your parents if possible or get whatever financial aid you can so that you don't have to work while you're in school. Seriously, with this last one. It sounds lame, but if it may be the only thing that can get you through your junior and senior years of CS.