How do you fix recording noise on computer?

I believe it's a hardware issue because it's only present when I record my audio. It sounds like a buzzing sound and like I'm in a cave.