This is a really interesting questions.

Firstly, a quick introduction:

The huge number of emotions we have are often a reason why we feel a mixture of feelings when things happen. Indeed, the [**Akeidas Yitzchak 97:1**][1] notes that the most difficult war a person faces, is the struggle between conflicting emotions or characteristics that goes on within one's personality:

> אמנם יש מלחמה אחרת יותר נסתרת ויותר מסוכנת והיא התקוממות התכונות ורוע הפעולות כקנאה והתאוה והחמדה והזדון והכילות ושאר הפחיתיות המתגברות באדם להרים יד במלך הוא החלק השכלי כי זה באמת חולי רע הוא ונפש הוא חובל ועם שזה כבר יוכר בפני האדם כמ"ש החכם לב שמח ייטיב גהה ורוח נכאה תיבש גרם (משלי י״ז:כ״ב). ושמחת הלב תתחזק בתוכן הפעולות הישרות כמו שתדאג הרוח בהפכיהם

It is therefore not easy to control our emotions as there are often multiple emotions at play. The only immediate control one has over his emotions is when he sleeps. As the **Ramchal** in [Derech Hashem][2] asserts:

>והנה בהיות האדם ישן כחותיו נחות והרגשותיו שקטות והשכלתו ג״כ נחה ושוקטת
>
> And note that when man sleeps, his faculties rest and his emotions are quiet; and his intellect also rests and is quiet.

That being said, there are ways to train our emotions and to channel them when needed and is something that we should strive to master. **Rabbi Mordechai Leiner, the Ishbitzer**, in his Mei HaShiloach when commenting on the verses in [Vayikra 25:29-30][3] which discusses houses in a walled city interprets the use of the keri kesiv in a more symbolic fashion:

> כי האיש אשר אין מעצור לרוחו נקרא אשר לא חומה, וזה שיש לו מעצור לרוחו נקרא אשר לו חומה, וזה שישארו כל זכיותיו של האיש אשר אין לו מעצר לרוחו ביד האיש אשר עצר את רוחו ושתק לו
>
>A man who has no control over his emotions has no wall, and the one who controls his emotions has a wall. And so we find that one who cannot control his emotions will remain in the possession of the one who controlled is emotions and remained silent.

So how then does one learn to control his emotions? Well, **Rambam** advises that one should try and maintain a degree of equanimity and if someone struggles with a specific emotion or character trait, they should go to the opposite extreme to help cure that defect. In [Mishneh Torah, Hilchos De'os 2:2][4]:

> מִי שֶׁהוּא בַּעַל חֵמָה אוֹמְרִים לוֹ לְהַנְהִיג עַצְמוֹ שֶׁאִם הֻכָּה וְקֻלַּל לֹא יַרְגִּישׁ כְּלָל. וְיֵלֵךְ בְּדֶרֶךְ זוֹ זְמַן מְרֻבֶּה עַד שֶׁיִּתְעַקֵּר הַחֵמָה מִלִּבּוֹ. וְאִם הָיָה גְּבַהּ לֵב יַנְהִיג עַצְמוֹ בְּבִזָּיוֹן הַרְבֵּה וְיֵשֵׁב לְמַטָּה מִן הַכּל וְיִלְבַּשׁ בְּלוֹיֵי סְחָבוֹת הַמְבַזּוֹת אֶת לוֹבְשֵׁיהֶם וְכַיּוֹצֵא בִּדְבָרִים אֵלּוּ עַד שֶׁיַּעֲקֹר גֹּבַהּ הַלֵּב מִמֶּנּוּ וְיַחֲזֹר לַדֶּרֶךְ הָאֶמְצָעִית שֶׁהוּא דֶּרֶךְ הַטּוֹבָה. וְלִכְשֶׁיַּחֲזֹר לַדֶּרֶךְ הָאֶמְצָעִית יֵלֵךְ בָּהּ כָּל יָמָיו. וְעַל קַו זֶה יַעֲשֶׂה בִּשְׁאָר כָּל הַדֵּעוֹת אִם הָיָה רָחוֹק לַקָּצֶה הָאֶחָד יַרְחִיק עַצְמוֹ לַקָּצֶה הַשֵּׁנִי וְיִנְהֹג בּוֹ זְמַן רַב עַד שֶׁיַּחֲזֹר בּוֹ לַדֶּרֶךְ הַטּוֹבָה וְהִיא מִדָּה בֵּינוֹנִית שֶׁבְּכָל דֵּעָה וְדֵעָה
>
>We tell the wrathful man to train himself to feel no reaction even if he is beaten or cursed. He should follow this course of behavior for a long time, until the anger is uprooted from his heart. The man who is full of pride should cause himself to experience much disgrace. He should sit in the lowliest of places, dress in tattered rags which shame the wearer, and the like, until the arrogance is uprooted from his heart and he returns to the middle path, which is the proper path. When he returns to this middle path, he should walk in it the rest of his life. One should take a similar course with each of the other traits. A person who swayed in the direction of one of the extremes should move in the direction of the opposite extreme, and accustom himself to that for a long time, until he has returned to the proper path, which is the midpoint for each and every temperament.

So according to the Rambam they way we control our emotions is to go to the other extreme which helps balance us and thereby over time, supress the emotion and gain mastery over it.<sup>1</sup>


----------


<sup>1</sup>Just as an aside, The **Piaseczna Rebbe - Rabbi Kalonymus Kalman Shapira** in his [Mevo HaShearim][5] actually does not like this approach:

>Until the chasidic period, the sequence of avodah was to first subjugate one’s body along with one’s feelings, and to quiet one’s emotions—indeed, to afflict oneself, in order to control them all so that they would not act at all, for they are all evil. Only then could one draw light to oneself, be it the light of his soul which he awakens and releases from his soul, or a light higher than his soul. All this was accomplished through apprehension, wisdom, thought, kavannot and yihudim...

Interestingly he argues that emotions and the like should not be suppressed as even the bad emotions are a channel to reach higher, spiritual holiness. 


  [1]: https://www.sefaria.org/Akeidat_Yitzchak.97.1.4?ven=Akeydat_Yitzchak_by_Eliyahu_Munk&lang=bi&with=all&lang2=he
  [2]: https://www.sefaria.org/Derekh_HaShem%2C_Part_Three%2C_On_the_Soul_and_Its_Activities.6?vhe=Handwritten_Manuscript_EH_47_C_32._1896.&lang=bi
  [3]: https://www.sefaria.org/Leviticus.25.29-30?lang=bi&aliyot=0
  [4]: https://www.sefaria.org/Mishneh_Torah%2C_Human_Dispositions.2.2?lang=bi&with=all&lang2=en
  [5]: https://www.sefaria.org/Mevo_HaShearim.3.11-12?ven=Entrance_to_the_gates,_trans._and_annot._by_Jon_Kelsen,_2019&lang=bi&with=About&lang2=en