How did the Church develop the terminology to explain the doctrine of the Trinity?

CCC paras 251-252

Reflection: The Church, in articulating the dogma of the Trinity, incorporated philosophical concepts like "substance," "person," and "relation" to express the ineffable mystery of God's nature. Rather than subordinating faith to human wisdom, these terms were given new meanings to convey a truth beyond human comprehension.
Action:  Today, I will reflect on the mystery of the Trinity and how the Church has sought to communicate it throughout history. I will explore the significance of terms like "substance," "person," and "relation" in understanding the divine nature. Additionally, I will engage in prayer, seeking a deeper appreciation of the mystery of the Trinity in my life.