So many players have this strange idea that the best way to develop a smash is to, well, smash a lot. It seems to make sense, but isn't always the best way. I've seen this in student after student - they work on smashing by smashing a lot, and the balls spray all over the place as they ingrain the habit of spraying the ball all over the place. Smashing is, first and foremost, a precision shot, and if you practice smashing by spraying the ball all over the place, you are being counterproductive.
Instead, focus on driving the ball only at the pace that you can control, and develop the precision at that speed. As you get better, increase the speed. If you find yourself spraying the ball all over the place, take it down a notch. Precision comes from good technique and timing, and these are things you should work on at a pace you can control. Spraying the all over the place is a great way to develop bad technique and poor timing.
How do you develop the precision needed to have a consistent smash? It starts with the fundamentals. A coach can help you with this, but here are five techniques that lead to precision on the forehand smash. (Most apply to the backhand smash as well.)
First, balance and positioning are key. If you aren't in position, or if you are off balance or not set for the shot, everything will be thrown off. When you turn sideways to hit a forehand, you have a big hitting zone to hit through, so positioning isn't so hard as long as you have active feet to move into position. You don't have to be fast, you just have to develop the habit of getting into position for each shot. If the ball is smashable, even a slow person should almost always have time to get into position. And balance is part of this, since if you step to the ball instead of reaching, you'll usually stay balanced.
Second, always use the same backswing. I believe this is the single biggest problem with players who can't smash well - they vary their backswing, and so never develop precision. It's like trying to hammer a nail where you bring the hammer up differently every time. Find that perfect spot to backswing to, and do it every time. Even if the ball is high, backswing to the same spot, and then raise the racket as needed in a continuous motion. It should become so natural and automatic that any variation to the backswing should feel unnatural and strange.
Third, use the whole body in a smooth progression from bottom to top - legs, hips, waist, shoulders, and forearm. (No wrist needed for this shot - it takes away some of the precision, though some do use it for extra power, especially against shorter balls. More often a wristy smash will just cost a player precision.) Many players tend to overuse their arm, resulting in a strained and awkward smash. The arm (specifically, the forearm) breaks into the shot only near the end, as part of the natural progression, after the shoulder rotation.
Fourth, and closely related to the third item above, is that you shouldn't have to strain to smash. A good smash is the result of good technique as power is created from that progression from legs to forearm. If you have to strain for a shot, it means you are overusing one muscle group at the expense of others. Here's a simple test - you should be able to smash at full power while carrying on a conversation. "Full power" may be misleading since you shouldn't actually try to smash using every muscle at full power. If you try to do so, you'll just get jerky muscles that don't work together instead of the smooth progression needed, and you'll lose both precision and power. Think of using each muscle at perhaps 80% power, which allows you to use all the muscles in conjunction, which actually leads to "full power."
Fifth, there should be a slight upswing with most smashes (unless the ball is somewhat high), which results in topspin to control the shot. Even a little topspin greatly increases your target area by making the ball drop. With a fast and grippy inverted surface, the upward part of the strokes is small; with a slower, less grippy surface (including all non-inverted surfaces), there should be a little more upward motion. Careful, however, not to stroke too much up, leading to a "rolling" forehand, where a player starts with the racket too low and strokes with too much topspin for a smash. This might be the beginning of a good loop (and some players use a loop kill instead of smashing whenever possible), but not very good for a smash. Instead, focus on meeting the ball more straight on, with only a slight upward motion, and sink the ball into the wood. There should be a satisfying smack when you make a good smash.
With these five tips, and with overall good technique, you can turn your forehand smash into a weapon that'll terrify opponents as they struggle to find ways to avoid it - which is a double-whammy, since you can dominate with both the smash itself or with the other strengths of your game that your opponent is no longer focused on avoiding.