As a kid, I had my own game with miniatures, it was called try to hit them with a Nerf gun from 20 feet away. I see that some members play games with miniatures today. How do you do that? I didn't know it was an actual "thing".
Actually, the first wargame rules, "Little Wars," allowed the players to shoot toy cannons at the figures. When I was a kid, we shot cork balls out of parris toy wooden guns. Rules sets lay out the specifics of movement, fire combat, melee and morale. For instance, an infantry unit might move 6" across clear terrain, hit on a 4 or higher on one die for each figure firing, and pass a morale test on an 8 or higher on 2 dice. The object may be to seize and hold terrain for x # of turns, or inflict sufficient damage in casualties or morale to force the enemy to withdraw. This is a very brief overview, but it gives you an idea of how the random parts of combat are commonly handled. Once you've played rules systems a couple times, you can just use a rules summary rather than turn to the books for every detail.