Don't be a "smartass".
That's a lesson I learned fairly quickly in life.
I was in the sixth grade and we had a colleague that was smarter than pretty much everybody else. He was quite good at all the subjects and was top of the class. He was also lucky - he didn't spend all his time studying, he was just smart and could learn more and easier than others.
He was also disliked by a lot of people in the class. The reason was that he was acting like a "smartass" sometimes, as if he was somehow superior because he was good in school. In a way, for a bunch of kids that know nothing about life except school at that age it made a bit of sense. But his behavior wasn't appreciated by anyone.
He wasn't bullied and he wasn't treated particularly bad, but you could easily notice the fact that he wasn't getting a lot of attention and people didn't behave particularly well around him. Most of the time people ignored him or told him to shut the hell up when he started talking about how to do this and that.
He also wasn't a particularly nice person when someone asked him for help. He even asked for money when someone asked to copy his homework. And most of the time he didn't even let you take a peak at what he did, simply because he was smarter than you, so you weren't allowed to see what he did and how.
You can imagine why he was disliked by most people in the class. I have to admit that I disliked him as well.
Later in life he changed his behavior, probably understanding that being smart is one thing, and acting like you're smart is another. People like to be around someone smart. Nobody likes to be around someone who acts like a smartass, especially if they're dumb.
Now, regardless of whether people liked him or not, he had one thing that helped him - he was actually smart. It doesn't matter how much you disliked him, you had to admit that he was smarter than you if you were part of the class I was in.
However, it's not always like this. Aside from those that act like they're smart, but they are, there are also people who act like they're smart, and they think they're smart, because they know a thing or two, but aren't really better than anyone around them.
I met those type of people, and I worked with them. It's hard to find a coworker more annoying than the guy who doesn't do much, but talks about everyone else not doing things the right way, because obviously he knows how to do them, he just doesn't.
It's even more annoying when you're being told, by one of those people, that you're not doing something right, or that you're not doing enough, when neither is true. They might even "show" you how to do your job, because they think they know better, but it will almost always result in failure or in them doing whatever it is you were doing but in a rushed and mediocre way.
The only thing those people are good for is to talk and to criticize, to act like a "smartass" but to never actually do anything and to never prove the fact that they're better than those they criticize.
So here's a lesson to learn from someone who's been around "smartasses" for a long time - if you don't want to be hated by pretty much everyone that works with you, be quiet and do your job. Try to fit in, and don't tell people what to do and how to do it unless it's obvious that they need help or unless they actually ask you to help them. If none of the above is happening, then mind your own business and do your own work. If you can do more than that just because you want to, that's great, but be quiet about it. Everyone will appreciate you more and will better tolerate your presence easier than if you'd talk all the time about things you know nothing, or very little about, regardless of how smart you think you are.