I've written about the importance of Grip and Stance, and how getting these wrong is the root problem with most bad technique. If you have a good grip and stance, then all you really need to do is focus on a good backswing. If you have these three right, then like a bow and arrow that's been pulled back, the most natural forward swing is going to be good technique. (For this article, we're focusing on topspin shots, but the same principles apply to backspin shots.)
So how do you make sure you have a proper backswing? Ideally, work with a coach. But you can analyze yours, piece by piece. First, is it too short or too long? You generally want the same backswing each time. By doing this you get a repeating stroke that feels natural to the point where any swing that's too long or too short will feel wrong - a helpful self-correcting tool. If the swing is too long, it'll take too long (and so can't use it in a fast rally) and be too cumbersome (and so hard to control). If it's too short you won't have time to generate force, and so your stroke will either have little power or be too jerky to control.
Second, do you backswing to the right height? For flatter shots, backswing mostly back and slightly below the ball. For more topspinny shots, backswing lower. A backswing to the wrong height leads to all sorts of problems as you subconsciously try to adjust.
Third, do you backswing with the right racket angle? You don't want major changes in your racket angle once you start your forward stroke, so you need to get the angle right at the back of your backswing. For flatter shots, the racket should be mostly straight up and down, perhaps slightly closed. (Against backspin it might be slightly open.) For topspinny shots, the racket needs to be more closed. (Against backspin, it's more straight up and down, though when looping with power you should close your racket some even against backspin.) Many players backswing with the racket too open, and adjust by closing the racket during the forward swing, leading to a loss of control.
Once you have these three components of your backswing set, you can just let the shot go like an arrow. Your body's the bow, your arm is the string, and the ball is the arrow that's going to hit a bulls-eye to wherever you aimed it.