The autonomic nervous system (ANS) regulates heart rate and contractility through its sympathetic and parasympathetic branches. The sympathetic nervous system increases heart rate and contractility via the release of norepinephrine, while the parasympathetic nervous system decreases heart rate through the release of acetylcholine. This balance allows the cardiovascular system to respond to changing physiological demands.