Abnormal protein aggregation and selective neuronal vulnerability are two major hallmarks of neurodegenerative diseases. Causal relationships between these features may be interrogated by controlling the phase transition of a disease-associated protein in a vulnerable cell type, although this experimental approach has been limited so far. Here, we describe a protocol to induce phase transition of the RNA/DNA-binding protein TDP-43 in spinal motor neurons of zebrafish larvae for modeling cytoplasmic aggregation of TDP-43 occurring in degenerating motor neurons in amyotrophic lateral sclerosis (ALS). We describe a bacterial artificial chromosome (BAC)-based genetic method to deliver an optogenetic TDP-43 variant selectively to spinal motor neurons of zebrafish. The high translucency of zebrafish larvae allows for the phase transition of the optogenetic TDP-43 in the spinal motor neurons by a simple external illumination using a light-emitting diode (LED) against unrestrained fish. We also present a basic workflow of live imaging of the zebrafish spinal motor neurons and image analysis with freely available Fiji/ImageJ software to characterize responses of the optogenetic TDP-43 to the light illumination. This protocol enables the characterization of TDP-43 phase transition and aggregate formation in an ALS-vulnerable cellular environment, which should facilitate an investigation of its cellular and behavioral consequences.