Living close to other people can be full of surprises. A dream home can be turned into a nightmare one purely based on the caliber of the neighbor, but we also mostly can't control who we end up living next to. A decent neighbor is sometimes something that can only be appreciated once we've had a bad one. It is amazing how unreasonable people can become about their own homes.
When you do find yourself being near somebody annoying, the best thing you can do without moving is try to keep the peace. You never know what stories may be behind them behaving that way, even if it does have a negative impact on your quality of life. A little sympathy might not turn you into friends, but it may make them slightly more bearable.
There are also times when you wind up being the bad neighbor, although you may disagree with the reasoning. As a general rule, if you aren't doing anything that is genuinely offensive, it is more likely to be their problem than yours. It's just that dealing with it can be a painful experience.