Patches are great for small bugfixes since they're easy to create and maintain. You should follow magento's official documentation to install the required composer plugin. Don't forget to add the required patch section on your composer.json or composer will not be able to see your patches.
- Go inside the folder that the file you need to fix is.
- Execute the
git init .
command. - Execute the
git add -A .
command. - Commit something. Ex:
git commit -m "start of patch"