Your company has decided to merge departments, each with multiple teams and different processes, competing products, or dissimilar cultures. In other words, before breakfast you’ve become the proud leader of a potential management catastrophe. You can already think of a handful of imminent clashes and redundancies – how will your directive to “make it work” actually work?

Finish your coffee. It’s time for some management magic.

When projects are consolidated or acquired, teams collide. The collision can be a positive, generative explosion of improvements and new ideas. But if done carelessly, it can cause damage to the product and flight of your top employees.

The good news? As the manager steering this ship, you have the capacity to shape the experience of both teams and make sure your products flourish as a result.

Your team leads are going to be looking to you to give them vital direction. Here are some activities that can help.

1. Remember that culture matters

Before jumping to solutions, take a little time to get your bearings. Many companies have architectural elements that drive wedges between teams, and mergers of former rivals can be painful. For example, Zynga’s policies pitted internal game teams against each other. While this did indeed increase speed of development, it was at the cost of smooth collaboration around shared projects, like Farmville.

Observe – Take a look at the physical space both teams work in and the way they interact. You’re looking for overlaps or obvious contradictions that can help you design a better merger. For example, suddenly dropping a bunch of tattooed developers into a suit-and-tie office may look great on paper but flop in real life.

Consider Identity – Existing teams can have strong identities that they are unwilling to leave behind. The loss of identity can be even more frightening than the loss of one’s job. A simple conversation with a few team members about how they see their role in the company can give you valuable information for approaching the merge.

2. Hear what people are saying

This combination of teams is not just an organizational change: It is an opportunity to do things better than they’ve ever been done. You can use simple conversations with the people you’re managing to design not only a better transition but also a more efficient department.

Interview the teams – Your teams are made up of competent, hardworking individuals…who are now frightened about the status of their positions. Simply talking to them will allay fears and give you data. What worked well about their former department? What was hard to navigate, and how would they change it? What are they looking forward to about the merger? This information will give you bright spots and motivations to create a positive message about the merger. Fears and complaints are valuable data – workshop the issues together.

Interview the team’s direct clients – Speak to the people your merging teams work with daily. What tasks or services did the each team excel at? What processes were hard to navigate, and what could be improved? Use this information to challenge the scope of change you were anticipating.

Even if you are not able to perform these interviews yourself, the information is important to collect. Remember, ask open-ended questions and let the interviewee lead. You’re not trying to sell them, you’re collecting information to make a decision later on.

3. Make the layoffs as painless as possible

There are massive mergers that involve the layoff of thousands, but more often you’ll find yourself in the position of personally choosing between candidates and saying goodbye to those you let go. Reduce the fear in the atmosphere by maintaining clear communication with the entire team through the process and treating each employee as a valued member of the work force—whether or not they will be continuing on with your company.

Internal Movement – If you’re grappling with a decision between two equally skilled employees for one position, consider placing one of them elsewhere in the company. These kind of lateral movements retain talent and build employee loyalty.

This kind of skill review can also be rich information for a larger company restructure. What new projects does the availability of ‘extra’ talent make possible? Perhaps these talented, and already trained, employees could be used to tackle a new project or create a new division. Challenge your assumptions of what ‘making it work’ can look like.

Help with the next step – Take a cue from the US Office of Personnel Management and offer skill trainings like resume workshops and career counseling to the employees you must lay off. Constant, truthful communication about the decision and the employee’s options can reduce the fear and negative feelings around the dreaded “pink slip.”

4. Consider prototyping

Do not get attached to your first ideas of how to “make it work.” You’re dealing with people, one (or two) businesses, and a lot of moving parts. Think of a prototype as a way to collect more data on one of your assumptions. A prototype recreates some aspect of your plan at a very low resolution. It’s a way to make the merger “real” before it actually happens. People’s reactions to your prototype are your data on how your solution fits.

So this is how it is – Curious about how two teams will get along? Pull a few from either side and have them work together on a common project for an hour. (For example, ask them to come up with a map of the gaps between their two departments and several suggestions of how to fill them.) After the experiment, ask them about their similarities or sticking points, as well as how they got along.

Your new department might mark the end of “the job as we know it,” but it could be the beginning of something even better. You have the opportunity to shape that future.