This. Also try to find a hammer that dampens vibration if you’re using it much. Makes a big difference to your wrists after a while. Less fatigue and pain = more precise swings.Find a hammer that fits your hand and feels comfortable. Choke up on the hammer handle while starting the nail. Once the nail is well started then slide your hand to the end of the hammer or wherever feels comfortable to you.
Swing the hammer while keeping your eye directly on the nail head. If you are looking at anything other than the nail head, that is where you will hit. Don't get concerned if it takes you ten swings to drive the nail in.
Use your wrist and forearm to swing the hammer. Do not use a "push type swing". Do not try to hit as hard as you can. Let the weight of the hammer do the work, not your muscles.