〜ようにする
Make an effort to (maintain a habit)…machine translation
FormationVerb dictionary form / ない-form + ようにする (ongoing habit: ようにしています)
ようにする means to actively MAKE AN EFFORT to do (or avoid doing) something on a regular basis. The most common form is 〜ようにしています: "I try to keep up the habit of…" — 毎日野菜を食べるようにしています (I try to eat vegetables every day). The nuance is conscious effort: you don't always succeed, but you keep it in mind and follow through.
With the ない-form, the pattern describes trying to avoid something: 甘い物を食べすぎないようにしています (I try not to eat too many sweets). The form 〜ようにしてください is a gentler reminder than 〜てください, because it asks the listener to "make a point of doing it" rather than ordering them to do it right now: 遅れないようにしてください.
Three sibling patterns are easy to confuse: ようになる is a change that arrives on its own over time (a result); ようにする is you making a sustained effort (a process); and ことにする, in a later lesson, is a decisive DECISION made at a single moment. Compare: お酒を飲まないことにしました (I've decided to quit drinking — decided once) ↔ お酒を飲まないようにしています (I'm trying not to drink — a daily effort).
Examples
毎日野菜を食べるようにしています。
I try to eat vegetables every day.
甘い物を食べすぎないようにしています。
I'm trying not to eat too many sweets.
約束の時間に遅れないようにしてください。
Please try not to be late for the appointed time.