How to patch modules on a D9 site:
Step 1: Find the patch that matches your issue:
a) Search "drupal *module name* issues" in a browser.
b) Click on the page for the module you searched for.
c) Look through the issues until you find one that's title matches your problem
d) Read through the page to be sure it describes the same issue you're having.
e) Click on the patch file to see the lines it patches.
f) If the patch modifies the same lines that your error message says, go to Ubuntu, cd into the site, and use the "code ." command to pull up VS Code. Once VS Code opens, follow the file path from your error message to open the file, then verify it looks the same as the patch.
Step 2: Add patch to composer.json:
a) Copy the link from the patch file
b) Open the composer.json of the site in VS Code and scroll until you find the patches section
c) When you find the patches section, add your patch as I have below:
(the drupal/module in orange can be found in the require section of the json file)
Step 3: Applying the patch
a) To apply the patch, use our ahoy total-update command. This will update the modules as well as apply the patch we added.
If Ubuntu doesn't give you any error messages, the patch should be applied and you can check that the errors on the site are resolved.