In my experience emotions have a big impact on your performance and golf swing, positive and negative. Even more than most people might think. Professional players know this because they often have to play although they are not feeling well. The weekend warrior can simply stay at home, if there is anything wrong. But there is also some valuable lessons to be learned from playing when you are not feeling your best. Usually it is not really the truth anyway.
It is the same effect you usually see in gyms and with New Year‘s resolutions regularly. At first people are motivated. But once they are confronted with road blocks and realize that progress usually comes with work, they lose their momentum. I do not want to preach and instead offer you a great exercise that might make you think more about this kind of things.
Go to the practice tee or work on your swing at home. While practising stir up some emotions in yourself. Don‘t be shy about it. Simply think about some things that make you happy, sad or angry. But keep practising.
Think of this exercise as some kind of method acting. You really want to feel those emotions.
Only this way you really learn how your emotions effect your game. It might be not the same as if you might be influenced by a real incident that might distract you on the golf course, but you can still learn something from it to handle different situations. In the end emotions have to be processed by you.
If you do not accept them as a natural part of you and your game, they will always throw you off. Some people are even laughing at comments like these but trust me that being able to handle your own emotions and doing exercises like these helps you big time dealing with different situations on and off the golf course.
Work on your swing while deliberately stirring up emotions in yourself (E.g. make yourself happy, angry, sad etc.).