Hebrews 3:12-19
12 Beware, brethren, lest there be in any of you an evil heart of unbelief in departing from the living God;
13 but exhort one another daily, while it is called "Today," lest any of you be hardened through the deceitfulness of sin.
14 For we have become partakers of Christ if we hold the beginning of our confidence steadfast to the end,
15 while it is said: "Today, if you will hear His voice, Do not harden your hearts as in the rebellion."
16 For who, having heard, rebelled? Indeed, was it not all who came out of Egypt, led by Moses?
17 Now with whom was He angry forty years? Was it not with those who sinned, whose corpses fell in the wilderness?
18 And to whom did He swear that they would not enter His rest, but to those who did not obey?
19 So we see that they could not enter in because of unbelief.
Random thoughts - and any other sorts of thoughts - are to be "brought into captivity unto obedience to Christ" (2Cor. 10:4) When they are not, they will set down roots in your mind, and grow, and shape how you think and behave. Have you been "taking captive" these random doubting thoughts? Have you been challenging them with the truth of the Bible? If you give these thoughts weight in your thinking and allow them to undermine your confidence and trust in God's word and in God Himself, you act as the Israelites did many millenia ago who "hardened their hearts in unbelief," and angered God, and died in the wilderness rather than the Promised Land God had said was theirs. Follow the advice of the writer of the book of Hebrews:
Hebrews 11:6
6 But without faith it is impossible to please Him, for he who comes to God must believe that He is, and that He is a rewarder of those who diligently seek Him.
Selah.