Subaru clicking noise

Hi! My husband’s Subaru Legacy 1998 station wagon - is getting tired. Its newest problem is a clicking noise that sounds like it is coming from the display panel (speedometer area). The clicking gets better once the car is running for a long time and usually on the highway. Stalling is another issue and also a “hiccup” type action when driving - we just replaced the spark plugs - this seemed to help a little but not for long…suggestions? Fuel pump