Overthinking can indeed cause heart problems.
Prolonged or even intense overthinking can lead to heart problems, especially when the overthinking is related to stress or anxiety.
The overthinking itself does not directly cause the heart problems or heart attacks although overthinking can cause unhealthy behaviors and even physiological changes which can increase your risk of heart disease.
Anxiety can increase your stress hormones such as cortisol, which can cause plaque buildup in your arteries.
And chronic anxiety and stress can also lead to persistent elevated heart rate and elevated blood pressure and even reduce blood flow to your heart.
Overthinking can also cause you to develop coping mechanisms which are unhealthy like overeating, smoking and excessive consumption of alcohol, which are all risk factors for developing heart disease.
And some people who overthink can develop cardiophobia which is a fear of heart problems, that can lead to increased anxiety and focus on heart related symptoms when you're experience stress.
Overthinking does not directly cause the heart problems or heart disease but it can indirectly lead to heart problems and heart disease by increasing stress and causing unhealthy behaviors, which can also affect your hearts physiological function.