This may not be the remedy for all your audio recording problems, but it helped me. I’m recording on a few years old ThinkPad with Windows 10, using a Focusrite Scarlett USB audio interface. One problem I had was clicks and pops, both in recordings and when playing audio files.
I’m using the Focusrite ASIO driver and I had already played with the buffer size settings. Google searches gave me a lot of tips, but most about increasing the buffer size, closing unnecessary programs and move around the USB audio interface between different USB ports (which all may help, but didn’t for me).
Then I found LatencyMon (https://www.resplendence.com/latencymon), which is a tool that analyses your computer and looks for things that can affect real-time audio handling. The tool showed me that I probably had problems with drop outs, clicks or pops (yes, that was correct), and suggested that the problem could be network related.
So what I did was to go to Control Panel > Network and Internet > Network Connections and disable the Local Area Connection and the Wireless Network Connection. And the problems disappeared!
I can’t promise that this will solve your problems, but it’s worth your while to check out if you have similar problems.