Carb engine I would check return springs on carb or vacuum leaks. Intake manifold leak will cause high rev idle and stalling.

Fuel injection I would replace the TPS (throttle position sensor).