How do you build cohesive teams that work well?

This is a great question, particularly because many companies are trying to figure this out.
Google dedicated a whole two-year project to this very goal of finding the secrets to team effectiveness. The project was named Project Aristotle and they studied 180 Google teams, conducted 200-plus interviews, and analyzed over 250 different team attributes.
Initially they thought that building great teams involved simply hiring the best people and putting them together. They later admitted they were wrong, very wrong.
They found that there were five key characteristics that effective teams exhibited:
1. Dependability
The ability for each team member to get things done, reliably and to a high standard. In particular the trust that each team member has in one another to do this.
2. Structure and clarity
Clear direction and outline of goals and well-defined roles and responsibilities. This is key to ensure maximal producitivity. Having clear goals serves as motivation for each team member as they feel as they are working towards something. Additionally each team member, by having a clear distinct role, feels as though they have a valued role in the team and are directly contributing to the overall progress of the project.
3. Meaning
There is a personal significance for each team member. Think of this as being more of a personal connection to the work you do. For example, many people choose to become teachers because they are passionate about sharing knowledge with others and fostering the development of the younger generation.
4. Impact
The team believes that they are contributing something that serves a greater purpose. Many of the employees at SpaceX, despite working long hours (15+ a day) under strenuous conditions, joined the company because they believe that they work they do will change the world. Elon Musk the CEO describes this as: “You want to wake up in the morning and think the future is going to be great - and that's what being a spacefaring civilization is all about. It's about believing in the future and thinking that the future will be better than the past. And I can't think of anything more exciting than going out there and being among the stars.” in his quest to make humans a multiplanetary species.
5. Psychological Safety
We’ve all been in situations where we feel stupid, shy to ask questions for fear we will be judged by others as silly and outright incompetent. An environment like this however suppresses you, limits your ability to take risks and feel comfortable voicing ideas and opinions that could well be beneficial to the team. Working in an environment where you feel ‘safe’ enough to express ideas and make mistakes leads to more successful outcomes as it effectively harnesses the power of diversity and community in the team.
I hope that helps 😃