Before recording guitar or bass, replace old strings, check that your instrument is in tune after every recorded riff (incl. bridge), and set the tone knob to maximum unless creatively justified.
Use a string damper, good cables, and a quality sound card. Proper string tension is crucial for guitars.
Prefer the cleanest and most technical player for recording.
Avoid using built-in features of your sound card - like a compressor.
Everything above is essential for achieving a good sound.