"Beloved, do not believe every spirit, but test the spirits to see whether they are from God." - I John 4:1I have drawn wisdom from Ignatius of Loyola on this subject, who spoke of the competing movements of our hearts as two different spirits at work within us. He describes the spirit of Consolation--the Spirit of God, and the spirit of Desolation, the influence of our accuser. To discern which of these your inner thoughts is coming from, you would consider the direction a given thought was moving your heart.
If we are influenced by the Spirit of Christ, our hearts should move closer to God. The more our life is in tune with the Spirit, the more we can expect the fruit of the Spirit to become characteristic of us, the first of which is love (Galatians 5:22). Our heart should become more like God's heart. Influence that comes from God will move us to think more about the good of others, and less about getting our own way. Likewise, because the Spirit of God is the Spirit of Truth, we can be confident that when a thought invites us to greater honesty and sincerity, this is from God (John 14:17). Along with these, the Spirit of God invites us to be at peace (John 14:27). This is a peace that gives us a sense of solidarity in our salvation, confident that God is working all things together--ultimately--for our good. The Spirit of Christ draws our hearts away from our smallness and doubts, and moves them towards the unfathomable, incomprehensible love of God which embraces us and holds us securely, producing confidence within us (Romans 8:38-39).
Our Accuser--the spirit of Desolation, as Ignatius calls him--tries to move our hearts in the opposite direction. When you feel yourself sinking into fear and powerlessness, this is not something that comes from God (2 Timothy 1:7). When you believe you are the worst sinner, and that everyone's sins can be forgiven except for yours, this is a thought from your adversary. When you feel a need to wear layers and layers of masks because you don't believe your authentic self is lovable, this is a lie, told to you by the Father of Lies (John 8:44). In every way, the spirit which does not come from God will move your heart toward yourself, to the unbearable weight of your problems, your unworthiness to receive the help that God provides, and great doubt about whether you have any hope at all.
Even more deceptively, the spirit of Desolation might get you to settle for a temporary good feeling, mistaking a temporary emotional move for the ongoing peace that would come from knowing God. The critical difference has to do with the direction of your heart. Even if this is making me feel a little better, am I preoccupied with feeling good, chasing an escape from anxiety, thinking mostly about myself, or does my good feeling come from understanding the promises of God, accepting them as my own, and thinking more about God, and what God cares about? Will I soon be chasing another way to feel better, or is this a deeper kind of satisfaction?
I continue to find great significance in what Paul prays for the Christians in Ephesus, that they would come to a deeper knowledge of the love of God, which leads to a significant strengthening of their inner person, and I believe, a greater ability to know the voice of the Good Shepherd when we hear it, as opposed to the voice of an imposter.