A large part of the practice seems to me to be changing one’s behavior so that it’s in line with the precepts. Naturally, this can be difficult depending on your background conditioning but the same dynamics apply to maintaining one’s sila as they do to making any behavior a habit.
Since I was in high school I have been fascinated with the idea of codes of conduct and lists of virtues. In college, I even went briefly on a book search for moral codes in the library before I became seriously involved with Buddhism.
It used to be that I would commit to a set of aspirations or rules and promptly crash and burn when I inevitably failed to live up to them. Decades and dozens of failures later I’m now at a point where I still see the failures as failings but I continue on, realizing that the work is piecemeal and that I have a long way to go before my sila is perfected.
I’ve learned not to be afraid of failure and made a deal with myself to try to learn a much from it as possible. I may not win every battle but the fight is never over unless and until I surrender.