The yips is condition where the player experiences involuntary movement that causes the miss.
The great golfer, Tom Watson, developed the yips late in his career. If anyone has good mechanics, it's Tom Watson. The source of the problem is psychological. The solution starts with changing your mindset when faced with the shot that is causing the anxiety. In Tom's case it was with short puts. If Tom could have solved his problem by just focusing on his mechanics, I'm sure he would have.
This involuntary motion is triggered by a specific series of thoughts. The key is to distract your mind from those thoughts in order to prevent the involuntary sub conscious reaction.
With most people, the issue is temporary and can be solved with planned mental distractions, like taking a sip of water or wiping down your cue. With some, like Tom, it's much more deeply rooted and probably required psychotherapy.