1- check battery for 12 volts
2- alternator charging 14 volts when running
3- the headlight flashing & relay clicking , tells me low voltage ,
4- scan the vehicle with ford scanner or equivalent & retrieve any fault codes from engine module & antitheft module
if the battery low it will trigger the alarm ,it seems that is what happened but testing is needed .
You can try the below procedure , but if battery bad or weak it want work ,if it is an alarm issue
Master reset Procedure
1- Disconnect battery Cables ( Negative & Positive Cables )
2- Hold cables Together for 60 secs ,then let go
3- Wait 15 minutes
4- Make sure all doors are closed
5- Reconnect battery Cables
6- Lock & unlock the vehicles using the key from driver door side (if you have a key fob with no blade key, just lock & unlock using the key fob buttons)
7- Enter the vehicle and attempt to start
Let me know if you need anything else on it , just reply back here & we can continue.
if you are good , Please Kindly rate me.
Hope I was helpful to you
A Positive Rating is Much Apreciated
This Post Will Stay Open for You To Come back and Ask me Any Follow Up Question You May have on this issue , even after you rate me
ASE Certified Tedchnician