How to apply patches that are created in core-dev
If the patch weren't already committed, you would need to reroll the desired patch against your Drupal Core version. This can be done by cloning the git repository of Drupal Core and generating a patch against the relevant revision of your version of Drupal.
The Drupal Core git repository can be found at https://www.drupal.org/project/drupal/git-instructions
See Making a patch on how to create a patch.
However in this case we can see that the issue has already been marked as &quot;Fixed&quot; and the patch of comment #19 was committed, so if you are on Drupal Core 8.1.x or up, you should already have the changes from that patch on your Drupal site.