There are many ways, e.g. using switches or multipliers etc.
One way might be the Analog multiplier example from Simulation examples for KiCad8/KiCad9/Eeschema/ngspice - #4 by holger.
One input is the pulse sequence (unlimited) of interest, the other is a gating pulse between 0 and 1, setting the output to 0 when not being 1.