Check the hood switch. It maybe bad. That will not let you start truck it will kill power to starter until hood is closed.
10th Gen F-150 XLT Owner. I love trucks, I'm a novice at best but it keeps me busy. I really enjoy modding and working on my truck