Topping a golf ball means that when you swing the club head of your golf club, it only strikes the upper top part of the golf ball. When this happens, the golf ball flies very low, if it leaves the ground at all and the golf ball will not travel very far.
There are two reasons that you top a golf ball. Either you are pulling the golf club up away from the golf ball during impact, or you are swinging the golf club too steeply down at the golf ball. Both of these actions will result in the club head hitting the top of the golf ball.
Looking at curing this mis-hit then, initially check your grip pressure. If you are holding the golf club too tightly and squeezing it rather than holding it this results in the muscles in your arms tightening and when this happens your muscles shorten, so effectively you will pull the club head up away from the ground and strike the top of the golf ball. The correct pressure to hold your golf club at is a 4 out of 10. Squeeze the handle as tightly as you can. This is a 10. Halve this to 5 and then relax a little more to 4. This has you holding the club rather than squeezing it and you need to work on maintaining this pressure throughout your golf swing. Once you know your grip pressure is correct, work on keeping your left arm straight (for right handed golfers) from your address position, throughout your backswing and then back to impact.
If you are bending your left arm, you are shortening the distance between the club head and yourself and effectively pulling the club head up away from the ground which will result in a topped golf shot. Work on maintaining a straight left arm. At address, create a straight line from your left shoulder, down your left arm to your hands and then down the shaft of the golf club to the club head. Maintain this straight extended left arm position throughout your backswing and work on pushing your hands away from your body, rather than pulling them in towards you. At impact, your left arm should be straight, it only bends at the elbow on your follow through.
Finally, work on maintaining your posture. Keep your head position and the tilt forward in your spine and maintain the same amount of flex in your knees. If you straighten your spinal tilt or your legs during your golf swing, you will lift yourself up away from the ground and lift the club head from the ground also, producing a topped golf shot. Work on maintaining your posture and rotate your upper body to the right. If you only lift your arms up, the golf club will be swung too steeply and as you swing back down dropping your arms, the club head will approach the golf ball too vertically and hit the top of the ball.
Maintain your posture and rotate your upper body to the right to improve your strike.