ないうちに

JLPT Level: N3
Meanings

before it happens

before doing something becomes true

before it ends/advances

before it’s no longer possible

while still in the state of not ...

Usage

V-ないうちに

Adj-くないうちに

Nのないうちに

Explanation
ないうちに is used to take action before a certain negative state or situation occurs, or before a change happens. The clause before うちに is in its negative form (plain negative). The main idea is doing something proactively while the other situation remains true (not having done/being in that negative state yet). It often conveys a sense of urgency or anticipation, similar to "before it’s too late" or "before I forget". Note that typical kanji usage remains natural for the verb or adjective in its ない form; use with verbs is most common. The pattern is especially common when the speaker wants to prevent a future undesirable change, or simply to act before a habitual or expected change occurs.
忘れないうちにこの本を返しておく。
わすれないうちにこのほんをかえしておく。

I'll return this book before I forget.

風邪をひかないうちに薬を飲んでおく。
かぜをひかないうちにくすりをのんでおく。

I'll take the medicine before I start to feel sick.