It is helpful to identify the printer model that you are using. Typically, a 3D printer will have a sequence for unloading the existing filament, via a front panel menu or similar interface. The same control system will also allow for inserting a different color filament and will run enough of the new filament into the extruder to purge the previous color.

If you think ahead with your printing plans, you will find the best method is to remove the filament after each job, unless you are certain you will be using the same color for the next job. If you choose not to perform that step, it is to your advantage to prevent clogs by feeding the existing color for a few millimeters, then extracting/unloading it when changing to a new color.

This is because some extruders will form a bit of a bulge right at the nozzle area, preventing a smooth removal if the hot end has cooled. Unloading the filament immediately after a print job is completed allows the bulge to be extracted while the nozzle is hot.

The above information would have greater validity (or less) depending on your specific printer and hot end configuration. Direct drive and bowden tube configurations may have different characteristics when it comes to problems with restrictions.

Our public library has a genuine Prusa i3 MK2s which occasionally gets stuck with filament change. Once the operators changed methods to removing filament while the nozzle is hot, those sticky moments vanished.