In the simple serenity prayer, composed most likely by Reinhold Niebuhr in the late 30s - early 40s, we find the essence to a spiritual approach to life: "Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference."
To insure that there is no misunderstanding of what falls in each category, I have explicated the prayer as follows: "Lord, grant me the serenity to accept the things I cannot change—which is the way my life is right now at this moment and was in the past, and the serenity to just be— the courage to change the things I can—which is how I relate to myself and others, the thoughts I think, the words I speak, the actions I take; and the wisdom to know the difference."
As the Buddha taught when he first turned the wheel of the dharma, the cause of our suffering is our cravings. And cravings are a result of our not accepting things as they are. They seek to change our life, whether regarding personal maters, finance, status, whatever.
Now, there is nothing wrong or unspiritual about wanting to change your life in ways that do no harm to others. But when that desire is based on a lack of acceptance—often adamant—of the way things are now or were in the past, that desire becomes a craving. We become attached to it. We certainly do not approach it with equanimity. And thus we suffer when we do to get what we want.
Whereas if we work to change things in our life while accepting things are the way they are at this moment and were because it's just the way it is, we approach that work with equanimity, with non-attachment. We can honestly say, "If it happens, great; if it doesn't happen, that's ok too."
The other aspect of the serenity prayer gets to the point that for the most part we have no control whatsoever over whether what we strive for will happen, partly because it usually depends on the actions of others. Partly because we don't have control over any aspect of the world which impacts us. But because we don't understand the distinction between what we have control over and what we don't, we suffer because typically we try to control what we have no control over, it doesn't happen, and we are frustrated.
What we do have control over is how we approach life, how we live life. We thus have the power to create our own reality, which is a reality free of emotion, in which we know we will be ok, safe spiritually, regardless what life provides because we have returned home, and will always return home, to our true Buddha self and so be at peace and happy. We have the power to create nirvana for ourselves (see my posts, "Nirvana - It's Right Before Your Eyes," and "You Can Be in Control").
But the reality that we typically experience has been created unconsciously by our ego-mind and its emotions, judgments, cravings, and attachments. And so we live in a state of endless frustration and samsara.
The cornerstone of the serenity prayer, or indeed of any effort to make real progress on the spiritual path—like following the Noble Eightfold Path—is faith and humility. It is faith that allows us to know and believe that if we act on the things we can control, if we create our own reality, we will be ok regardless what happens because we will be at peace. And it is humility that allows us to accept that things are the way they were and are right now because it's just the way it is. And it is only by controlling our ego-mind rather than allowing it to control us, that we are able to have that faith and humility.
Thus, if you want to end your suffering, the focus of your spiritual work should be on freeing yourself from the control of your ego-mind. That is what will open up dharma gates for you, will give you the serenity you need to accept the way things are at the moment, and the courage to change the things you can.
While freeing yourself from the control of the ego-mind is no easy matter—an understatement if ever there was one—the path to do that is clear (see my post, "How to Free Yourself from the Control of Your Ego-Mind").
May you experience peace and happiness.