Car struggles to turn on?

I have a 2004 Ford Ranger 3.0L and it has recently had some issues starting up. It takes several cranks before it starts up the first time. Within 15 minutes of it being turned off, it will start back up completely fine.

The battery is new and I have replaced the fuel pump fuses. What exactly is happening?

Added (1). The fuel filter has just been replaced as well

Added (2). The truck seems to run fine once it has started running

Maybe the starter needs to be replaced.

when it does turn on fine, i would just drive it to a shop and ask for a quote.Quotes are free for diagnostics, then figure out for your self what you want fixed now, or what can wait.Either go to a local Ford dealer, or other auto shop nearby.

There cold be a number of reasons for this. If the car cranks fine which it sounds like it does then there could be a computer problem. The car could be burning too lean or too rich both of which will make it hard to start. If it is burning too rich you will see black smoke come out the tail pipe. If it is a diesel and you see white smoke come out the tail pipe then you may have bad glow plugs or a bad grid heater. Even a car that burns oil can have trouble starting, I know a guy that had a car that burnt oil and due to the oil in the cyclinders it had trouble starting this is shown by blue smoke coming out the tail pipe.

There are other things it can be also but here are some things it could be.