I'm a big fan of practice what you want to get better at.
You want to visualize better? Then do a lot of visualization during your games and study time. Yes, you're going to be terrible at first, just like everyone else.
I accidentally chose to solve tactic puzzles in a bad way for tactics, but a good way for visualization. I tried to see the whole solution, including all relevant variations, to the very end before moving the first piece. What I mean is I tried to actually visualize clearly the final position (I'd move my eyes around the board saying where each piece and pawn was for the end position for example). If I was having trouble seeing it, this basically involved calculating to the end over and over until I had the final position basically memorized.
I also went through an endgame book and got tired of setting up positions over and over, so I tried to work though the main line and any variations in my head. Sometimes they were complicated so I would give in and set it up on my board, but I always tried to go as far as I could in my head first.
I did these things accidentally, without intending to improve my visualization, but they helped.
So I understand the super GMs can visualize positions exactly in their heads and can play blindfold games without much trouble.
I can't do this at all, and my visualization is terrible which makes it hard for me to calculate beyond ~4 moves deep. I understand that when the good players calculate lines, they are able to reach certain positions in their heads, and then calculate from that position, whereas every single line I calculate has to come from the original position.
My visualization is mediocre in the endgame, but it's the opening and middle game that I struggle to calculate with precision.
How is it exactly that you visualize, and how can I get better at it?