If you want to know WAYS to control these emotions – there can be many ways, like meditation, regular workout, breathing exercises and so on. But these work only at the surface level (not saying that these have no effect, but they don’t address the root cause of these emotions).
The BEST way (as asked by you) is to get a deeper understanding of these emotions. To understand these feelings you need to reflect upon some questions like what makes these feelings to emerge when do they come, what makes them go, is there any pattern in these feelings, are there some people because of whom these feelings come etc. However this process can take a good chunk of time, but it will surely give concrete and long-lasting results. This process will lead you to better self-awareness as well.
However, you might need to seek professional help (from a counselor or a psychotherapist) to reach this understanding.
In case you want more clarification, please feel free to message me.