A loss of courage is just one of the side effects of law-breaking. The boldness required to break the law is soon replaced by the fear of getting caught. Our fear eventually reveals and confirms our guilt. In Leviticus 26, God explicitly told His people what would happen if they chose to break His law. Fear shows our lack of a close relationship with God.
Confession is the first step in restoration.
By coming clean with God, you'll discover that your fear will be fleeing instead of you. Few things instill more courage than a good conscience toward God.