Select the file from the web part if the file lives on your site. If you choose an Office file or PDF from the web part, you can rename and move the file within the site and your link will still work.
At times, you might need to create a link to a file or folder on a Windows 11/10 PC. If so, you can follow this article to find out how you can get the hyperlink or path of a specific folder or file ...