We want to change the image filename:
pexels-photo-721996.jpeg
to:
fairground-carousel.jpeg

Under the column 'uri' of the table 'file_manged' we can see the location of the file is:
public://2022-11/pexels-photo-721996.jpeg
As such within our directory 'web/sites/default/files/2022-11' we need to change the filename to the new desired filename.
Within Drupal the filename is visible under the files tab.

Steps
1. Change filename in the Drupal database table 'file_managed'.


2. Clear the cache. You'll then see within Drupal as follows under 'Files' and 'Media' assuming the image was uploaded via media.
Files

Media

In both cases the thumbnail is missing as we have not yet updated the filename. This has to be done on the server.
After the filename has been updated the thumbnails will once again appear.
Note, if you're wanting to change the media name which is separate to the filename then the tables that need updating are:
- media_field_data
- media_field_revision
And that's how to change the name of an image file that's already been uploaded into Drupal.