The word “Trinity” is not used anywhere in the Bible, but trinitarianism is biblically based. The doctrine emerges from an attempt to do justice to the biblical portrayal of each of God the Father, Jesus, and the Holy Spirit as divine, without contradicting its insistence that there is only one God.
The solution to this conundrum arrived at by the Church’s theologians is this: the one God exists as three persons. Father, Son, and Holy Spirit are each distinct persons, and are each fully God, but they are fully the same God.
Two heresies have appeared and reappeared in opposition to this doctrine: modalism and tritheism.
Modalists fail to do justice to the distinctness of the members of the trinity. They see Father, Son, and Spirit as three different manifestations of the same god, one god in three guises. This is not orthodox trinitarianism because it claims that God is three persons, only that he reveals himself in three forms.
Tritheists fail to do justice to the unity of the members of the trinity. They see Father, Son, and Spirit separate individuals, each a god in their own right, and so fall into the trap of believing in three gods. This is not orthodox trinitarianism because orthodox trinitarianism is emphatically monotheistic. Whatever may be said about the members of trinity, on orthodox trinitarian theology, it must be maintained that there is only one god.