Ignition problem

just replaced starter on 1998 mustang 3.8 turns over and starts just fine but now every now and then i turn it off and then it wont start turns over but wont start come back later and it starts right up runs great

Check the ignition system and make sure that power is getting to it when the trouble happens. That is always the first step for ignition problems. If that is ok then the system itself needs to be checked. Check the error codes for any clues there, like a crank sensor issue.

when you try to start it but it won’t, is the fuel pump cycling? Next time instead of cranking on it, turn the key to “ON” and listen for a low whirring sound that should last for a second or two.