Choose the right kind of foundation. Look at your skin type; if you have oily skin, look for a non-comedogenic foundation and if you have dry skin, try something creamy.
Also, make sure it's right for your skin tone: Test it along your jawline and if it basically disappears into your skin then it's a good fit for you.
Be sure to pick the right applicator for your skin texture — a flatter brush is ideal for those who have hyperpigmentation or acne, while a fluffier brush works well for those with a more even texture.
Less is more when it comes to non-cakey makeup, so use less foundation than you think you need, then build on as needed. Use a great concealer like this one to cover up any discolorations, so you don't end up piling on your foundation.
Remember to blend, blend, blend. This is really important to avoid that cakey look. Start from the middle and work your way out.
If you have oily or combination skin, use a dusting of translucent powder to set your look, especially on your T-zone and under your eyes. A weightless, finely-milled option like this one is key!