From Matthew Henry’s commentary on these verses:
Here is, 1. A great duty required of us, and that is to appear for the relief of oppressed innocency. If we see the lives or livelihoods of any in danger of being taken away unjustly, we ought to bestir ourselves all we can to save them, by disproving the false accusations on which they are condemned and seeking out proofs of their innocency. Though the persons be not such as we are under any particular obligation to, we must help them, out of a general zeal for justice. If any be set upon by force and violence, and it be in our power to rescue them, we ought to do it. Nay, if we see any through ignorance exposing themselves to danger, or fallen in distress, as travellers upon the road, ships at sea, or any the like, it is our duty, though it be with peril to ourselves, to hasten with help to them and not forbear to deliver them, not to be slack, or remiss, or indifferent, in such a case. 2. An answer to the excuse that is commonly made for the omission of this duty. Thou wilt say, "Behold, we knew it not; we were not aware of the imminency of the danger the person was in; we could not be sure that he was innocent, nor did we know how to prove his innocence, nor which way to do any thing in favour of him, else we would have helped him.’’ Now, (1.) It is easy to make such an excuse as this, sufficient to avoid the censures of men, for perhaps they cannot disprove us when we say, We knew it not, or, We forgot; and the temptation to tell a lie for the excusing of a fault is very strong when we know that it is impossible to be disproved, the truth lying wholly in our own breast, as when we say, We thought so and so, and really designed it, which no one is conscious of but ourselves.
(2.) It is not so easy with such excuses to evade the judgment of God; and to the discovery of that we lie open and by the determination of that we must abide. Now, [1.] God ponders the heart and keeps the soul; he keeps an eye upon it, observes all the motions of it; its most secret thoughts and intents are all naked and open before him. It is his prerogative to do so, and that in which he glories. Jer. 17:10 , I the Lord search the heart. He keeps the soul, holds it in life. This is a good reason why we should be tender of the lives of others, and do all we can to preserve them, because our lives have been precious in the sight of God and he has graciously kept them. [2.] He knows and considers whether the excuse we make be true or no, whether it was because we did not know it or whether the true reason was not because we did not love our neighbour as we ought, but were selfish, and regardless both of God and man. Let this serve to silence all our frivolous pleas, by which we think to stop the mouth of conscience when it charges us with the omission of plain duty: Does not he that ponders the heart consider it? [3.] He will judge us accordingly. As his knowledge cannot be imposed upon, so his justice cannot be biassed, but he will render to every man according to his works, not only the commission of evil works, but the omission of good works.