Note: Often used in ~ようにしている (habitual effort) form.
The grammar structure ようにする expresses making a conscious effort to do (or not do) something, or trying to ensure that something happens. It conveys the idea of working toward a goal or establishing a habit through one's own will and effort.
When attached to the dictionary form of a verb, ようにする means "to try to" or "to make sure to" do something.
When attached to the negative form of a verb, ようにする means "to try not to" or "to make sure not to" do something.
Using ようにする (non-past) expresses a decision or intention to start making an effort from now on, while ようにしている (~ている form) indicates that one has already been making that effort as an ongoing habit.
While ようにする focuses on deliberate effort by the speaker, ようになる describes a natural change or development – something that comes to be the case over time without implying personal effort.
This pattern is very common when talking about health habits, self-improvement, and lifestyle changes. It often appears with time-related words like まいにち毎日, いつも, なるべく (as much as possible), and これから (from now on).