Every golfer runs into a period when their game is totally off. It happens, its a slump. Lots of things go wrong on the course. Your swing is off, you get poor breaks, you play well through nine holes, the other nine holes are a mess, it is usually pretty volatile and because of that, it is hard to pinpoint exactly what the hell is going on.
Golf is very challenging because of all the variables that are at play. But when you are hitting a wall with your game, try to just go with it. Relax and observe the difficulties you are facing and adapt your game. Use the slump to your advantage and learn. Get good at the punch out shots when you are in the woods, learn to scramble, learn to critically think and manage your way through the round, learn to control your emotion, learn to putt well if you can't hit a straight shot, etc. It is all about making the most of the situation. Golf teaches you a lot, and it should be looked at that way. You can improve so many other areas of your game when you are playing poorly. You can get better and begin to learn how to play different shots from the most unfavorable positions on the course.
These agonizing slumps prepare you to become a better, more well-rounded golfer. Embrace the struggles because it teaches/prepares you for the better rounds, big tourneys, and pressure moments you will inevitably face on the course.