The 20th century Lutheran professor Franz Pieper, with some good tips on fighting temptation:

An important rule in this warfare is to do at once the very opposite of what the flesh and the devil propose. When we are tempted to murmur against God, then the best answer is to praise God for His many mercies. When we are tempted to entertain our own or other men’s thoughts about matters of doctrine and life, we should simply ask: What has God revealed on this matter in Scripture? It is important for the Christian not only to read God’s Word daily, but to commit to his memory as many Scripture texts as possible, so that he will be ready to repel the attacks of the flesh, the world, and the devil with the Word of Scripture, whenever and wherever they occur. Christ taught us by His example that in this way the victory is obtained (Matt. 4:1–11).
Experience proves that following this rule will insure success. Do not wait with the praise of God until your heart feels that God should be praised, but in the midst of your discontent take up the strains of “Now thank we all our God,” and your discontent and murmuring will melt away. When death rises up as a frightening specter before our eyes, words of Scripture such as “Today shalt thou be with Me in Paradise” will banish the frightening specter. The feeling that our affliction entails very deep and persistent sorrow will vanish in the light of passages such as “Rejoice in the Lord alway (πάντοτε).” The thought that the temptation besetting us is too strong to be borne is silenced, e.g., by 1 Cor. 10:13: “God is faithful, who will not suffer you to be tempted above that ye are able.”—When he was tempted by false doctrine, Luther confessed: “Often I have not been able to refute the devil’s arguments” (St. L. IX:1339), but the doubts disappeared like fog before the sun as soon as the Holy Spirit reminded him of the words of Scripture dealing with the matter. “The Word they still shall let remain.” See Luther’s words on the ability not merely of teachers, but of all Christians to overcome all error by taking their stand on the clear Word of God without “glosses” (St. L. IX:1235 ff.).

— Pieper, F. (1999, c1950, c1951, c1953). Christian Dogmatics (electronic ed.) (0). St. Louis: Concordia Publishing House.