Type guards narrow a union type at runtime checks. typeof checks primitives, in checks properties, instanceof checks classes, and custom predicates return x is Type.
Expanding on the short answer — what usually matters in practice:
A tiny example (an explanation template):
// Example: discuss trade-offs for "how-do-type-guards-work-(typeof,-in,-instanceof,"
function explain() {
// Start from the core idea:
// Type guards narrow a union type at runtime checks. typeof checks primitives, in checks pro
}