Start here. This is the direct spoken answer to practice first.
Overview
Hydration expects the client to adopt compatible server-rendered DOM rather than render a different initial tree.
I keep the initial server and client render deterministic from the same inputs. Code that needs window, storage, layout measurements, or a browser-only library runs only in the browser at an appropriate render boundary. I avoid changing the initial template solely based on a platform check because different server and client DOM can cause hydration mismatches.