Below was extracted from https://www.britannica.com/topic/Trinity-Christianity
Neither the word “Trinity” nor the explicit doctrine appears in the New Testament, nor did Jesus and his followers intend to contradict the Shema in the Hebrew Scriptures: “Hear, O Israel: The Lord our God is one Lord” (Deuteronomy 6:4). The earliest Christians, however, had to cope with the implications of the coming of Jesus Christ and of the presumed presence and power of God among them—i.e., the Holy Spirit, whose coming was connected with the celebration of Pentecost. The Father, Son, and Holy Spirit were associated in such New Testament passages as the Great Commission: “Go therefore and make disciples of all nations, baptizing them in the name of the Father and of the Son and of the Holy Spirit” (Matthew 28:19); and in the apostolic benediction: “The grace of the Lord Jesus Christ, the love of God, and the communion of the Holy Spirit be with you all” (2 Corinthians 13:13). Thus, the New Testament established the basis for the doctrine of the Trinity.