The low hanging fruit here is:
* ALWAYS spend time with your future boss prior to accepting. Ideally try to spend as much time as you reasonably can. If this isn't possible push back pretty hard about why. Your direct manager is usually the biggest reason for your unhappiness at a job. "People don't leave jobs, they leave bosses" is a cliche for a reason.
* If people seem unhappy when you interview, don't assume it's just how they feel that day.
* Make sure you get a sense for the culture and whether you want to be part of it. If you're not into constant group activity, make sure you're not joining a hyper-intense "everyone hangs out with each other all the time" sort of place. Conversely if you're new in town, don't join a company where everyone is focused on working hyper efficiently and bouncing to go home to their families. Neither is right or wrong, but they can definitely be right or wrong for you.
* If you're connected, track down people who left the company and ask about your future boss. Were they hard to work with? Do people like them? If you have friends at the company (ideally, not reporting to your potential boss) ask about how your boss (and the department) is perceived by the rest of the company.
* Hit up linkedin and track down ex employees, ideally in the same job role. See where they ended up, and hit them up and ask why.
Good luck!