There are three different types of tops: a "steep" top, a "mis-radius" top, and a "shallow" top. There are only a certain number of ways to produce each type of top.
Steep tops are those made on the way down with the bottom of the swing in front of the ball. This can happen when you lean ahead and turn too far in front of the ball (coming over the top).
Mis-radius tops are those where the clubhead simply does not get enough underneath the ball's equator. This can be caused by having clubs that are too short, standing too far away, swinging too flat, coming out of your posture, or shortening your arms.
The shallow top is made by having the bottom of the swing too far behind the ball and contacting it on the way up. This happens when the club flattens and the head is "stuck" behind the player. It can also occur when a player tilts or leans back on their way to a reverse pivot. Another way this happens is if the player casts the club early with their hands, which moves the bottom of the swing back.
Once you can identify your mistake and the cause for it you can target your correction and be on your way to playing better golf.