This is pretty normal ngl
It's easy to fall of the rails, and hard to stay on track. Don't just give up - put yourself out there and make friends as a first goal. Many people I know only make their good friends in second/third year, rarely all the way from first year, so don't feel as if there's no time for that.
You've already taken the first steps in ensuring you're doing what you want to do by changing course - WELL DONE! A stupid person would continue with what they hate, but you've already taken the hardest step - so wait it out, give it your all with an open mind - because what you may be studying could be your passion (it was for me - I considered giving up but then on the same day I went into a Middle East and China lecture which became my passion/speciality!)
Living by yourself can be nice, and it's no excuse to not make friends. Especially if your socially nervous, it's good to have a retreat at the end of the day! Worse case scenario you're there for a year, and then you can move out. Try to make your flat as homely as possible with decorations and things that make you feel at home. Any empty flat is gonna feel/look like absolute s***, it's only made homely when you make the effort.
DON'T GIVE UP UNLESS ALL COMPLETELY FAILS, WHICH IT HAS NOT!!!! There is still plenty of time to have fun and get to know loads of people, unis are big and full of opportunity so don't just abandon it all now because you're in a bad place. DON'T become some church helper if that's feels wrong, do something you're actually passionate about and be guided by that, not by depression and anxiety. Try and seek medical help and psychiatry if it's getting worse, my sister did that and now she's so much happier because of it.There's absolutely no shame in it. I believe in you, so you have someone who thinks you can do it. Now prove me right.