Consistency isn't just something you need to learn to do; it's an attitude. It's the idea that, no matter what happens, you can keep the ball in play longer than your opponent. If you convince yourself you can do that, then you no longer are hesitant about your shots, and so your consistency shoots up. Consistency is mostly in the mind. (Plus lots of practice.)
You have to practice to develop this consistency. For example, to be a consistent rallier, you need to do practice drills where your practice partner plays all over the table and you relentlessly rally, keeping the ball in play at a good rallying pace.
But too often players practice attack, attack, attack! It's a lot easier to go from consistent rallying shots to consistent attack then to go from wild, inconsistent attacks to consistent attacks. Develop that consistency, and focus on that at each level you reach. This doesn't mean just keeping the ball in play or becoming a blocker; it means that your attacks need to be consistent attacks, as does every aspect of your game.
Player after player, as they develop, learn the lesson of consistency. Take 10% off your attacks, focus on consistency (and placement), and your level will shoot up.