If you have ever lived or worked in a foreign culture, you have likely confronted situations in which the natural, comfortable “default” behavior from your native culture turns out to be ineffective for a situation you find yourself in within a new cultural environment.

In each of these situations, you don’t just struggle with understanding cultural differences. Rather, you struggle with the far more challenging task of actually changing your culturally ingrained behavior. I call this ability global dexterity—the capacity to adapt your behavior, when necessary, in a foreign cultural environment to accommodate new and different expectations that vary from those of your native cultural setting.

Global dexterity can be a challenging skill to acquire. It requires the capacity to act on what you know: the ability to mold and shape your behavior in foreign cultural settings so that you can be simultaneously effective and appropriate in that setting without losing who you are in the process. You can feel anxious and embarrassed about your inability to master the new cultural rules; you can feel inauthentic when performing these new behaviors, especially if the new rules conflict with aspects of your ingrained values and beliefs. You can also feel frustrated and angry about having to adapt in the first place, wondering why the other side can’t simply adapt to you. These feelings can interfere with your ability to successfully adapt your behavior—and, as a result, your professional reputation and effectiveness can suffer.

In my years of research and teaching, I’ve found that people can face three core challenges when learning to adapt their cultural behavior:

The competence challenge: Feeling that your knowledge and skill is not up to the task of adapting behavior

The authenticity challenge: Experiencing the new behavior as being in conflict with your accustomed way of behaving and with your preexisting cultural values and beliefs

The resentment challenge: Feeling that the very act of adapting cultural behavior is a burden and an imposition.

Individually, any one of these challenges can be taxing, and collectively they can be very difficult to overcome. When you feel resentful about having to adapt behavior in the first place, embarrassed and anxious about your ability to do so, and awkward and uncomfortable about how disingenuous it feels to act so differently than you are used to, it’s very hard to muster the psychological resources necessary to adapt your behavior.

So what can you do to overcome these challenges? How can you find a way of adapting behavior that does not feel so uncomfortable and inauthentic? It sounds impossible, but it’s really quite straightforward. The key is to realize that you have much more power than you think to craft behavior that fits the new culture and that also fits you.

The first step is learning the new cultural rules, or what I refer to as the cultural code. Learning this code is key because it’s the first step in helping you devise a way to feel authentic and be effective at the same time. It provides you with insight into the particular set of challenges you face when adapting your behavior in a particular situation and how you might be able to adjust your behavior in order to respond to these challenges. What do I mean by the cultural code? Each situation you face—whether it’s learning to give constructive criticism, make small talk, negotiate, participate at a meeting, or ask a favor of your boss—has certain rules for appropriate behavior in a given cultural setting. Although there are undoubtedly many different ways to characterize these rules, I portray them in terms of six dimensions that capture the expectations that others have for our behavior in a foreign setting.

These six dimensions represent key aspects of communication that differ across cultures, and that previous researchers in psychology and cross-cultural communication have shown to predict important personal and professional outcomes. Of course, there are many potential dimensions of communication style, and these six features are not the only dimensions that exist, or that differ across cultures. However, in my experience, this particular set does an excellent job at capturing cultural differences in a succinct, but comprehensive manner:

Directness: How straightforwardly you’re expected to communicate in a particular situation. Are you expected to say exactly what you want to say, or to “hint” at something in a more indirect manner?

Enthusiasm: How much emotion and energy you are expected to show when communicating. Can you express how you feel, or is it more appropriate to hide your positive feelings?

Formality: The amount of deference and respect you are expected to display with your communication style. Are you expected to show a high level of respect when communicating with someone in a particular situation, or can you be more informal?

Assertiveness: How strongly you are expected or allowed to voice your opinion and advocate your point of view in a particular culture and in a particular situation in that culture. Should you be forthright in expressing yourself, or work at hiding or sublimating your point of view?

Self-promotion: The extent to which you can speak positively about yourself in a given cultural situation. Should you actively promote your positive qualifications or be more self-effacing?

Personal disclosure: The extent to which it is appropriate to reveal personal information about yourself to others. Should you be open and forward in expressing details about your life, or is it more appropriate to hide these personal details?

Each situation you encounter in a foreign setting will have a specific cultural code for behavior along each of these dimensions. When motivating workers in India, there is a certain level or amount of assertiveness that you will be expected to show as a leader. When bonding with work colleagues after hours at a restaurant or bar in Japan, a certain level of enthusiasm is expected, which is quite different from how enthusiastically you are expected to behave in other situations that you might encounter in Japan.

The point is that cultural norms are not generic and that context matters a great deal. This six-dimensional approach for diagnosing the cultural code provides flexibility that you can use to apply to any situation you may face in your work abroad to get a valid and reliable portrait of the local cultural norms.

This piece originally appeared in Fast Company and was excerpted from my book: Global Dexterity: How to Adapt Your Behavior across Cultures without Losing Yourself in the Process.

Andy Molinsky is a Professor of International Management and Organizational Behavior at the Brandeis International Business School.

Follow Andy on twitter at @andymolinsky.