Get it right at the source... but don't be afraid to add FX too!
When recording, it's so important to try to record the sound as you'd like to hear it in the final mix. This means not cutting corners on how well you play the part, the tuning or using a rough mic placement and hoping you can 'fix it in the mix'. (Fixing it in the mix almost never works and even if you do improve it, just think about how amazing it would have been if you'd got the recording stage correct.)
One thing that's mentioned slightly less however, is how it's not only okay but an extremely important skill to develop to use things like EQ and compression on the way in as well.
Now, this is done as standard in studios where they have, for example, a large console with EQ and compression built in, but what about home studios without any of those tools?!
"Hold on", I imagine you're thinking. "You just said don't fix it in the mix".
Well, that's right. Don't look at this bit as mixing. Once you've recorded your part the very best you can with just great playing, instrument set up and mic technique (and you should feel really happy with the results), listen back in your DAW and using EQ, boost the parts of the frequency spectrum you feel best accentuates and cut the areas that you feel don't contribute to the sound you're going for. Once you've done that, bounce that track to a new one, so you've commited those plugin moves! Once you get practiced at this, you'll find many tracks don't need any processing at all in mixing!
If you're new to this, I'd suggest picking one frequency to boost and one to cut and stick to a maximum of 3dB. If you're using compression, stick to 3dB - 6dB initially. As you get used to this workflow, you can become more daring (If necessary! Don't assume you have to. I regularly stick to 3db - remember, it's a cumulative effect across all the tracks!)
One final bit of advice - think about where you're boosting and cutting in relation to other tracks. Have a plan! If you go boosting 100hZ on every instrument, you'll just get an unnatural build up and won't get the separation you're trying to achieve - it'll almost cancel itself out. Try to avoid boosting or cutting the same frequency again on subsequent tracks as much as you can! (It's okay occasionally).