It takes a lot of persistence to prevent unharmonious states of mind from coming to be. Right Effort is a Mental Discipline and it involves persisting in your efforts to live your life in keeping with the ideals of the Noble Eightfold Path (also known as the Middle Way).
Don't be too rough on yourself when you catch yourself having messed up somehow. Just pick yourself up, dust yourself off, and then gently but firmly set yourself back in the right direction. Practice makes poifect!