Sometimes mind gets boggled. Often it is maligned with waswas. Question arises:how do we know that what we are thinking is a shetan's whisper and not a logical thought. E. G praying for dead to come back is obviously a waswas. But what about wishing to have something permissible, but impossible because logic tells u so?
Another example could be how the docs sometimes tell us that only dua can save a person, while their logic is convinced otherwise?
But these are examples to clarify my point. Please think beyond the examples.

Ooh here is another example. Its only hypothetical so please no need to elaborate on it. A teacher tells their student they will fail, regardless of the effort they put in. The student still works hard, but he knows that since the teacher is responsible for grading the test, logically he is going to fail.. So his mind is telling him that praying would do no good..

Or may be someone dwelling on the past. Like wanting something that's gone..