I understand that the following HTML will allow a different image to display on smaller screens but I assume that in this case both images will be downloaded to the device, thus rather than decrease page load time it will increase load time.
The MDN page on responsive images has live code examples.
If you open the browser developer tools, go to the network tab and filter for images, you can see how the browser handles it. For some of the examples you may have to switch between using device mode and not to see the difference (depending on device resolution).