Help us help you. By posting the year, make, model and engine near the beginning of your help request, followed by the symptoms (no start, high idle, misfire etc.) Along with any prevalent Diagnostic Trouble Codes, aka DTCs, other forum members will be able to help you get to a solution more quickly and easily!
I can drive the truck for a week or two and drives perfect, next time i get in turn the key and nothing. No codes i do here the fuel pump and relays clicking. Security light is not on.
Simplest thing to do is hook a test light up to the signal wire on the starter. Route in nice and just drive it until it acts up. If it lights during no crank I’d put a starter in it.