If you have a single extruder 3D printer and you want to switch out your filament for another color during a print then you can use this Marlin firmware command to assist. It's pretty simple to alter and add to your gcode using text editor of your choice. VSCode has some gcode extentions but you can also just use notepad.
https://marlinfw.org/docs/gcode/M600....
The code I use. See above Marlin link for details.
M600 B2 X10 Y10 Z10 E5.0 L30