[verb (potential form)] + ように [verb (intransitive)] + ように [verb ない form] + ように [verb (non-volitional)] + ように
[i-adj plain] + ように [na-adj な] + ように [noun の] + ように
The structure ように is used to express purpose, manner, or desired outcomes. It translates to "so that", "in order to", or "in such a way that" depending on context. Unlike ために, which pairs with volitional verbs (actions you directly control), ように is used with non-volitional expressions – potential forms, intransitive verbs, negative forms, and verbs describing states or outcomes beyond direct control.
Use ように when the goal is something you cannot directly will into happening – such as an ability, a natural outcome, or preventing something.
The verb before ように is typically in the potential form (はなせる話せる) or negative form (わすれない忘れない). If you can directly control the action, use ために instead: compare 日本語を勉強するために図書館に行く (I go to the library in order to study Japanese).
When combined with する, ように expresses a conscious effort or habitual commitment toward a goal.
When combined with なる, ように describes a change of state – something that was not previously the case has now become so.
This is very common with potential verbs to express gaining a new ability.