The Spanish viejo (“old”) comes from the Latin vetus meaning the same, “old.”
From the same Latin root we get the English inveterate (an SAT word meaning, a “long-ingrained habit.”) Lets break down the English: the Latin prefix in- means, well, “in” and the “veterate” means “old”, from the same root vetus. So an inveterate habit is really just a habit you’ve had for a long time!
We can see that the v-j root of viejo maps to the v-t of inveterate. The Latin -t- turning into the -j- sound isn’t that common (more common is that it turns into a -sh- sound, as in syrup and jarabe) but isn’t too uncommon: we can hear the similarities between -t- and -sh- if we say the sounds together quickly!