Won't Start When Cold?

I have a 1996 Ford Explorer with a 4.0 engine, all of a sudden a week ago it was around 40 degrees outside, and I turned the key and the engine was turning over but it wouldn’t start, later that day when it was warm outside it started up first try. It did this all week. what could the problem be that it won’t start when its cold but will when its warm? btw I used this vehicle all winter with no problem.