In general, the closer a source is to the event which it purports to describe, the more one can trust it to give an accurate description of what really happened.
In other cases, Bible scholars use the way a text is written (changes in style, vocabulary, repetitions, and the like) to determine what sources may have been used by a biblical author.