Takes practice and patience, like everything else in virtual (and real-life) racing. I usually have the HUD on initially if it's a car I'm not used to driving. But as I get to "know" the car better, I'll turn it off for immersion purposes. I'll either turn off the instruments, or the entire HUD.
You have to learn to listen for your car's RPMs mostly. Listen and try to remember what gear you're in. I actually count at first. Most corners are left behind in 2nd gear for me, so I'll count up. Then as I approach a turn, I'll count back down again. After awhile, the counting is not even necessary..the entire process becomes second nature.
Of course, there will be those inevitable times which I'm in the wrong gear at the wrong time.

I'll think I'm in 2nd gear but the engine will start hitting its RPM limiter!

Or I'll think I'm in 3rd, but after pushing the accelerator, it's obvious the engine is revving much too low.
Online, I usually have the HUD on, only turning it off if I get
really comfortable with the folks I'm racing against.