If you feel friendless and unappreciated, it's very possible that you're just an obnoxious know-it-all.
Next time you find yourself talking to someone, pay attention to how often you contradict them.
They might say, "I saw this video about how the pyramids weren't actually built by slaves..." and you, having a doctorate in Egyptology, can't help yourself. You just have to educate them.
Except, wait a second, you don't actually have a doctorate in Egyptology, do you?
Whatever the topic, ask more questions than you make statements, and try to just enjoy being in someone else's company for a change.