When sadness arises spontaneously, that is usually a distinct sign that it is being generated by one’s evil inclination.
A tzaddik said, “Once, when I was about to recite my prayers, I began to grieve over my sins: What kind of person am I? I am so contemptible, so wretched, so sinful.
But then it occurred to me: Do I have such thoughts when I am about to eat? No! And so I understood that this was no other than an artifice of my evil inclination.”
Rabbi Adin Steinsaltz