Striving for the perfection of one’s attitude is a worthwhile endeavor. Never focusing on whether perfection is achieved, focus on the efforts to get there. When diverted from this focus, notice it, then return focus to the efforts.
Practice stilling the mind: give attention to only the breath, in, out — when the mind wanders, return attention to the breath. Apply this practice in daily life, when moods sour, observe thoughts, notice their affects, still the mind.