Proverbs 19:3

The foolishness of man perverteth his way: and his heart fretteth against the LORD.

A man's own foolishness perverts his way, ruins it and spoils his course. That perverted way is a wicked path that ends in death and destruction, so the foolish reap the corruption of the path they chose.

The foolishness consists in disobeying what is forbidden and in wasting time and neglecting duty. Instead of recognizing his own part, the man frets against the Lord and blames God for misfortunes that are the consequences of his own acts. This warns against complaining against heaven and resenting the Lord.

The fretting takes the form of saying God does not love them, putting on injured innocence, posing as martyrs, and accusing others of partiality. While there are mysteries in adverse providences, most troubles are not mysterious but are the pit dug by one's own hands.