Inherited from Old Spanish, inherited from Latin tingere, from Proto-Indo-European *teng- (“to soak, dip”).
Practice speaking and memorizing "teñir" and many other words and sentences in Spanish.