To get a good sounding result in the end, one of the most important steps is to record your tracks properly. Therefore, I'll list some recommendations on what equipment you need and how you can record different sources of audio. Following these recommendations will not only make your mixing engineer happy but also enhance the sound quality of your final song!
Audio resolution: Always record in WAV format! Minimum resolution: 44.1 kHz sample rate, 16-bit depth. My recommendation for audio production: 48 kHz sample rate, 24-bit depth, or even 32-bit (float) if possible. When exporting your tracks, make sure to use the same resolution as you recorded them in
Recording Volume: Ensure your recorded signal falls within the range of -18 to -8 dBFS, with peak levels no higher than -6 dBFS. If your levels reach 0 dBFS, your recording will start to clip and become irreversibly distorted
Check your Equipment: Make sure your audio interface as well as your cables are working fine without any crackles your noise. Use fresh batteries (e.g. in your DI box or active bass guitar).
Guitar+Bass: Tune your instruments carefully. If you are using a capo, tune again. And use fresh strings, at least if your current set is older than a few weeks
Record with a click: Always record with a click track (metronome) from the very beginning to record your song at the right tempo and keep the tempo constant (this is also true for the pilot track!)
Record a pilot track first: I recommend to start your recording with a "Pilot track" which guides all following recordings through the song. The pilot track should include the main melody and chords and also indicate important rhythmic patterns and breaks. E.g. the pilot track could consist of a recording of the main vocals together with a strummed acoustic guitar
Record in a logical order: Personally, I'd recommend to record your drums right after your pilot track, then bass and the main chord/rhythm instruments. Afterwards, continue with lead instruments (guitars, keys, brass elements). Then lead vocals. Finally, you can add backing vocals, double vocal tracks, and add some ear candy (additional percussions, guitar sprinkles, spheric key sounds, effect or ambience sounds)
Vocals, Acoustic Guitars, Percussion, Brass, and Others - Microphone Recordings:
Use a condenser microphone + microphone stand and shock mount. If you are recording vocals, also use a pop filter!
Record in a quiet environment and record only one instrument/track at a time. There should be no noises, music, or instruments being audible in the room when recording
Don't hold any paper with the lyrics/notes or even the mic in your hand! If you don't know the notes by heart, use a note stand and prefer a tablet over paper for displaying your notes/lyrics.
Best practice is to wear closed-back studio headphones when recording so you can hear the playback and click but still record only your instrument/voice in isolation. If studio headphones are not available, I recommend using in-ear-headphones.
If you are not too experienced, watch a youtube tutorial about the right mic positioning.
Electric Guitar, Electric Bass - DI and Amp Recordings:
Always record a DI signal: If your interface has a 'Hi-Z'/'Instrument'/'Guitar'-Input, you can plug your guitar cable directly into Line-In of your interface. Otherwise, use a DI box that lives in your signal chain between instrument and audio interface
If you feel that you need to record your amp (because you have such a great sound), split your signal using a DI box, record your dry DI signal on one input channel and your amp signal on a second input channel. For recording your amp, either use the line out of your amp or use a condenser/dynamic microphone by taste
There exists great amp simulation software, that might even sound better than your real amp and make recordings of actual amps redundant
When recording, don't directly face your monitor/computer directly, as the electromagnetic radiation will cause additional noise in your pickups. So keep 1-2 meters distant and turn away from your monitor. Ideally, bring your body between monitor and guitar
Pianos, Keys, Synth - Software Instruments/MIDI Recordings:
There are great sound libraries for acoustic/electric piano sounds, synths, as well as drums/percussions that most of the time sound better than mic'ing an actual instrument. In these cases you record a MIDI signal that is translated to sound using these libraries.
I recommend using a MIDI-keyboard or E-Piano with a MIDI-out. Connect your keyboard to your computer via a (MIDI-to-)USB-cable and record a MIDI track
Acoustic Drum Kits - Multi-track Recordings:
Unfortunately, recording an entire drum kit requires much more microphones, channels, and know-how than everything else
To receive decent results, I recommend working with an audio engineer in a recording studio for drums
Alternatively, you could record a MIDI signal (see above) and use a drum sound library. In this case, you can record your MIDI drums using a MIDI keyboard, MIDI pads, or an electric drum kit.