Hi there! And welcome!
I have the same problem when I'm mtnbiking along the edge of something where there is nothing but air off to the side. Like slinke, I concentrate on my breathing and I also concentrate on looking far out into the distance. As I get tense I tend to focus closer and closer in front of my wheel which is a no-no on the road or trail. It makes it hard to ride a clean, straight line.
I have found the breathing exercises used in yoga are a great deal of help. They help me to focus, relax and block out the bad thoughts. I literally tell my brain to shut up and let my body do what it knows how to do. I try to do this silently so as not to alarm my fellow riders.
Frends know gud humors when dey is hear it. ~ Da Crockydiles of ZZE.