For onions specifically:
Sharpen your knife and make French onion soup.
You’ll cut so many that you’ll figure it out.
For everything else: pinch grip and crab your other hand. The pinch grip is where you rely on a pinch between thumb and forefinger on the blade just in front of the handle to grab the knife. It’s the choke up of holding a knife and will make you much safer and give more control. Crabbing your other hand is where you curl your fingers up like ginger roots instead of letting them extend out like little baby carrots. It will keep you from being hurt when something goes wrong and allow you to go much faster because you’re not having to slow down to avoid cutting yourself.