Composer Error: “The … file could not be downloaded (HTTP/2 499)”

If you’ve encountered the error “The ‘https://packagist.org/providers/search for a package : php.json’ file could not be downloaded (HTTP/2 499)” while running composer require, This issue often arises…