Trying to change a habit is not as easy as it looks. This is because no habit exists in a vacuum. Habits are fully integrated into people's lives. Therefore, changing a habit almost always involves self-examination.
If you habitually cut short your diet because you feel too deprived, you can start with making sure your diet is more fulfilling. But if feeling deprived is part of a larger emotional pattern, you will have to work on fulfilling yourself in other areas of your life in order to stay on your diet.