i dont want to change voltage but only regulate input voltage
The voltage spikes in automotive environments are common, but since they are brief, DC-DC converter is not usually needed - you can go by with linear regulation. What you are looking for is a transient voltage limiter. Unfortunately TVS diodes aren't usually a good solution here, as the transients can be long enough to burn out the TVS and after that you've got no protection.

What you can do is roll your own voltage limiter as described in this article:



By changing the zener (D1) to 24V you'd get 24V limiter.