Start by reading and meditating on Phil.2:14: “Do all things without murmurings and disputings.”
…You complain because you misunderstand (or just miss altogether) the grace you have received and the purposes of God in your life. You misunderstand the grace you have received by not recognizing it and receiving it with gratitude. Life, breath, and all of God’s provisions for your life are acts of his kindness and are truly wonderful, and yet they all seem to disappear when the small inconveniences of life appear.
In most of your complaining you miss the good purposes of God for your life – purposes he has made clear. ‘God causes all things to work together for good to those who love God’ (Rom.8:28 NASB). This truth should remain a constant meditation, particularly in a world filled with frustration, frailty, and failure. Though we are not always aware of the particular ways in which God causes all things to work out for our good, we have this promise, and it should be enough to challenge and conquer our complaining spirit.
…Perhaps the lesson is that you haven’t driven the gospel deep enough into your heart and mind. Otherwise it would bear fruit precisely where you need it. Are you complaining today? Consider the grace of God in all of life, and in the gospel particularly. Be assured of his purpose in all things inconvenient and tragic, and you will find the cure for complaining.
Taken from Chap.35 “Stop Complaining” (found in Part Three, “The Gospel and You”) in Note to Self: The Discipline of Preaching to Yourself by Joe Thorn (Crossway, 2011), pp. 109-110.
You might also benefit from reading (or re-reading) this “note to self” we posted previously, about giving thanks.