How to fix my views in life?

I lost my best friend of 2 years after a sexist comment I made and he won't talk to me. He told me he doesn't agree with my views and doesn't like me for who I am. It's been like this for a month or 2 now, and I'm honestly fed up of it, coming home every day feeling lonely.

I realised at school now, I don't actually have any friends. Everyone likes to talk to me, but they never really take anything beyond a casual conversation, and nobody ever messages me. I can tend to be annoying at times to people and they just get pissed off at me, or always joke about (with) me at my own expense because I act so goofy.

I have bad hygiene, bad work habits, always chronically online, pretty much have no proper enriching hobbies at home, and I overall just hate myself. I tried to reach out to my friend a couple times, but says I don't mean whay I'm saying and only doing it to get him to like me. I don't know what to do tbh , but I want to see if I can change myself, but I don't know how or where to start. I want to change my views and my lifestyle, but I'm close to just giving everything up.