Make respecs costly or inconveniently placed. The goal is usually not to allow arbitrarily resets at any point in the game, but to allow you to optimize for what the game actually is in practice. It’s not at all rare to spec as a fire mage, and it turns out the game barely features ice monsters anywhere. Or you avoid playing a monk because they have too many drawbacks, but the game eventually throws equipment at you that eliminate most of those drawbacks.
But you usually have to make the specialization choice up front.