How can we know which books are inspired?

Only by decision of the providentially protected Church.