Drove 45 miles from work on dirt road now will not idle on 1995 Toyota Tacoma

Truck ran fine tell I got into town pulled up at the first stop sign and it died.It started right up but now it will not idle.when it starts to die I hear a clicking noise in the passenger side foot well.What would cause this sudden problem?

Asked by for the 1995 Toyota Tacoma