After centuries of narrowing the list of books trusted to be used in the Liturgy the Church formally agreed upon the list of books in the New Testament at various councils attended by many bishops and approved by the Bishop of Rome.
Certainly, the current list of New Testament writings neither fell from the sky with a bow and a message “From: God” nor were picked overnight by the councils of the last fourth century. The list of books in consideration had been narrowed considerably by generations of use within the liturgy. However, as a Church that spanned the known world, more than common consensus was needed. By the lend of the fourth century the Church was ready to make a decision.
The first council that appears to have the same list of New Testament books as we have today is the Council of Rome in 382. A council in Hippo (North Africa) in 393 did the same and this council was affirmed at two councils in Carthage (also North Africa) in 397 and 419.
These councils didn’t close the canon; that didn’t technically happen until the Council of Trent in 1546. However, they solidified within the Church the writings of the New Testament to be trusted as inspired. It was no longer up to individual churches to maintain their own list; that era had passed.
That the bishops and the pope confirmed the New Testament books with certainty gives Catholics confidence in them.