God, grant me the serenity to accept the things I cannot change,
Courage to change the things I can,
And wisdom to know the difference.
If there’s a remedy when trouble strikes,
What reason is there for dejection?
And if there is no help for it,
What use is there in being glum?
There are similar sentiments expressed in both of these statements, one from a 20th-Century Protestant theologian from the United States and the other from an 8th-Century Buddhist scholar from India. At their core, both are about taking action when there is something which you would like to see be different in your world and also not letting things which cannot be changed make you unhappy.
Niebuhr's statement adds something (perhaps implicit in Shantideva's) -- the idea that wisdom is required to discern between the things you can control in life and the things you cannot control. This is broadly applicable in all aspects of life -- it's been on my mind a great deal recently as failing to keep this philosophy in mind is something that I believe was at the root of much of my recent frustrations.
More narrowly, it can absolutely be applied to our writing. For example: rejections. Once you've submitted something to a publisher you have absolutely no control over the decision they make. Getting unduly upset over a rejection -- or even a bunch of rejections -- isn't productive and won't lead to future happiness.
What can lead to future happiness is doing your best to rationally analyze things and see what you can learn from the rejections and, if you've received some, your acceptances. It could be that you need to improve your craft before you will reach some of those markets (A true statement for many of us, I'm sure.) or it could be that you're submitting to markets which really aren't looking for what you're sending them. In either of those cases, while you cannot control the past rejections there are things you can do to try to decrease the likelihood of future rejections.
One area to pay special attention to is interpersonal relations. This is so tricky, because other people's opinions and feelings and plans of action aren't necessarily 100% immutable. At the same time, it can create a lot of ill will if you push too hard to try to change someone else. That's why the default suggestion for critique partners is for the critique recipient to not dispute the critiquer's comments on the work. Once two people have worked together over time, there's some room for latitude here. But room for latitude requires that wisdom which Niebuhr spoke of. You have to know when you're engaging in healthy, synergistic dialogue and when you're going over a line and irritating the other person. When in doubt, err on the side of caution, and assume that the other person's perspective is not something you can change. (In more serious matters than writing there may, of course, be a situation where you feel that attempting to make the change in someone's life -- if you see them going down a dangerous course -- is so important that it's worth the risk of damaging the relationship.)
A lot of unhappiness arises from people miscategorizing concerns in their lives. If you battle endlessly trying to change something which is truly unchangeable, you are expending energy in an endeavor around which you are bound to fail. More subtly, if you decide that something which is bothering you is something which is beyond your capacity to change then you are losing the opportunity to gain the happiness which making that change would afford you.