On windows there should be a "patch.exe" in the fpc folder. On Linux "patch" is often part of the distro.
cd lazarus
patch <the_patchfile
You may or may not need a newline at the end... not sure.
Also the leading git stuff, may have to go for patch. (all to and including the "index" line)
In case of this patch, you can just open the file in an editor, and go to line 1399++
The lines with leading "-" are currently in there, and need to be removed.
The lines with leading "+" will go in instead (without the +).
The other lines are kept as they are.
Remove 2 lines, add 6 lines