Question: After committing to the precepts, what should be done if one breaks them?
Answer: There should be sincere repentance to express remorse and resolution to not repeat the mistake again. This can be done with chanting of the Repentance Verse before a Buddha image: https://thedailyenlightenment.com/2019/05/how-bodhisattvas-should-always-practise-repentance
Question: What should be done to be mindful in upholding the precepts to prevent breaking them?
Answer: There should be mindfulness of thought, which will take care of speech and actions – to ensure there is no giving in to the Three Poisons of greed, hatred and delusion – which is what leads to breaking of precepts.
This can be done with sincere and regular practice of mindfulness of Buddha in everyday life: https://purelanders.com/2016/02/17/how-do-i-start-nianfo-practice This works as it re/tunes us to our Buddha-nature, away from the poisons.