You have several options for reducing environmental distractions. The first is your choice of microphone—a dynamic mic is better at only picking up audio near the microphone. Condenser mics pick up audio from a wider area, which make them ideal during group recordings and distressing when your dog's barking. But if you're asking this question, you probably already have a mic. Try turning down your mic's sensitivity and instead position it closer to your mouth. You can also enable background noise cancelling in your device's companion software (as applicable), or even potentially through your graphics card's software (i.e., Nvidia RTX Voice or AMD's Noise Suppression). For specific issues like sounds from keyboard or mouse use being picked up, you can also put your mic on an arm that clamps to your desk (and even go one step further and combine an arm with a shock mount). For a room fan or heavy breathing, add a pop filter or a foam windscreen to your setup.