The thomp-thomp of your heart beat will occur roughly three billion times in your lifetime. Over the last hundred years, scientists have learned a lot about the heart's mechanisms, as described in the dense, but clear video from the Guardian above. This is a summary of how a single heartbeat occurs, based on the description Michael Shattock of King's College London gives therein
Pacemaker cells at the top of the heart get things going, putting out an electrical signal on a steady but variable rhythm based on the body's needs. That signal spread down through the top chambers of the heart to the atrioventricular node, which directs the signal rapidly to the bottom of the heart. The pumping motion then spreads upward. Shattock noted this wiring makes for an efficient mechanism.
The electrical impulses that induce a heartbeat are generated by individual cells exploiting differences in the concentrations of sodium and potassium ions. (Ions are the name we give to molecules carrying an electrical charge.) There is lots of sodium outside the cell and relatively little inside whereas there is lots of potassium inside the cell and not much outside. Proteins open up channels through the cell membrane and like cold air rushing into a warm house, the sodium molecules push into the cell. Remember the molecules are ions, so a higher concentration of them makes the cell more positive. That's the electrical action that we call a nerve impulse. To end the activity, potassium channels open up and potassium rushes out of the cell, bringing down its positivity. Sodium is also pumped out of the cell through what is called active transport.