1990 Ranger won’t run

I have a 1990 ford ranger xlt with a 3.1 engine. It will start when the engine is cold, but won’t run after a few minutes, then won’t start right away. Have already changed the gas filter. It will stay running when I use starting fluid.