Toxic substances can interfere with the heart's electrical signaling pathways, leading to arrhythmias. They can alter ion channel function, disrupt the balance of electrolytes like potassium and calcium, and directly damage cardiac tissue. Some substances may also affect the autonomic nervous system, which controls heart rate and rhythm.