We can become easily discouraged or frustrated when wrong thinking comes into play. Faulty thinking is not of God. Being frustrated, fearful, discouraged, depressed, or anxious leads us to not being in right standing with God. Look at Job; God initially called him blameless.
“Then the Lord said to Satan, “Have you considered my servant Job? There is no one on earth like him; he is blameless and upright, a man who fears God and shuns evil.” Job 1:8
And then, after many attacks by Satan, his wife and his friends, Job was worn down and wanted his life over. “I loathe my life; I would not live forever. Let me alone, For my days are but a breath.” Job 7:16
Job allowed what came upon him: losses and physical attacks to discourage him, and he then challenged God’s justice. God rebuked him, and Job repented. “Therefore I abhor myself, And repent in dust and ashes.” Job 42:6. When Job repented and prayed for his friends, God refreshed him. “Now the Lord blessed the latter days of Job more than his beginning;” Job 42:12
Remember, “For though we walk in the flesh, we do not war according to the flesh. For the weapons of our warfare are not carnal but mighty in God for pulling down strongholds, casting down arguments and every high thing that exalts itself against the knowledge of God, bringing every thought into captivity to the obedience of Christ,” 2 Cor 10:3-5