Does the Gospel of Thomas and Gospel of Peter have validity? How did we get the books in our New Testament that have today?

Apologetics Canada: https://apologeticscanada.com/
Wes Huff: https://www.wesleyhuff.com/