When you first use a treadmill, you may want the assurance of holding onto the handrails for stability. But that is not a natural way to walk or run. Holding onto the handrails doesn't allow you to move naturally with arm motion, or to achieve a good stride. It also won't allow you to achieve good walking posture.
Learn to let go of the handrails, even if it means walking or running at a slower pace for a few sessions. You will be getting a better workout at a slower pace without holding on than you would at a faster pace holding on.
This advice is for those without significant disability and balance issues. If you have a condition that requires holding onto the handrails, such as low vision, balance problems, etc. then you should continue to use the handrails. But consult with a trainer or physical therapist for advice on how to achieve good walking posture even if you need to use the handrails.