The browser initiates a request and then changes its mind, either with the user navigating away or by cancelling.
In HTTP/1.1, the only choice to avoid the download of the response content was to close the connection, since there is no way for the client to communicate this intention of aborting the request to the server. Closing the connection is the way.
In HTTP/2, if the client wants to abort the request, it sends a RST_STREAM. When the server receives a RST_STREAM, it will stop sending DATA frames to the client, thereby stopping the response (or the download).
The connection is still usable for other requests, and requests/responses that were concurrent with the one that has been aborted may continue to progress.
Typically, applications do not need to do anything and are not aware of RST_STREAM, it is all done by the browser and by the server implementation.
It is possible that by the time the RST_STREAM travels from the client to the server, the whole content of the request is in transit and will arrive to the client, which will discard it.
However, for large response contents, sending a RST_STREAM may have a good chance to arrive to the server before the whole response content is sent, and therefore will save bandwidth.