Thoughts and actions can lead to emotions. If you can observe your thoughts processes, these processes can also be analysed. After that you can make predictions how emotions appear and you can establish some control over them.
A similar method is used in cognitive behavior therapy. This discipline investigates connections between thoughts, believes, and attitudes from one side, and emotions from another side. All of these also can be connected to other things like behavior.
Despite all this some people can claim that emotions can not be controlled. As I can see you can not control emotions only if you do not know how to do that and do not want to study this topic. One of possible reasons for this can be a belief that emotions are too chaotic to be controlled or that they do not follow any consistent rules.
But as I mentioned above, they follow their own rules. These rules may not be simple, but some of the rules can be discovered. You can start with observations, then use the scientific method to find possible rules.
The scientific method uses procedures and skills usually taught in critical thinking courses. These steps are: spotting a problem and formulating a question, formulating a hypothesis, looking for alternatives to formulate more hypotheses, simulating outcomes in different cases thus making predictions, designing an experiment and testing hypotheses, then analyzing all steps and results. Even if emotions may work like a black box and you don’t know exactly what happened inside your mind, experimenting like this can connect conditions of experiments and theirs results.
So even if you lack understanding of finer details of your emotional processes, you can treat them as black boxes and still get some understanding how produce desirable results and get some control. Also you can use books about cognitive behavior therapy to learn some basic rules how emotions appear when certain conditions are met, these books usually have a number of examples how people work on their cognitive processes. But you still need to make a number of observations and probably some experimenting to understand how these processes would work in your mind.