Good morning young lady/man,
Firstly, take it easy:- It is quite unlikely that you have a serious cardiac condition at the age of 17/18; if you had an inherited cardiac disease , then chances are you would have had serious symptoms such as cyanosis [blue skin and nailbeds due to poor oxygenation of the blood], dyspnoea [breathlessness], etc in early childhood or your doctor would have picked up a heart murmur on the routine screening every newborn baby goes through.
You say you have anxiety; what did your GP say when you saw him/her twice recently? Remember tachycardia [a "racing" heartbeat] is a known symptom of anxiety states cos adrenaline is released from the adrenal glands [cap-like structures on top of the kidneys].
An ECG cannot predict a "cardiac arrest" except under some very rare situations, and as I said, even common cardiac conditions are v unlikely in a teenager, assuming you have no other symptoms.
Having said that, if you are worried, depending on how well you know your GP and the GP,s own preferences/style of practice, an ECG would do no harm, and if it is normal, as is v likely, it will give you some peace of mind, yeah?
Good luck & take care!
M