Crouch glitch fix

Is there any way to fix the crouch glitch. If you don’t know what the crouch glitch is it’s where you crouch then have way up you crouch again. Your view looks as if you standing and you can shoot if you’re behind a barrier, but you’re still crouching.

Even tips to fix this would be nice.