The main issue is that you probably still want the user to wait for the result before they can take the next step. So you are trying to not freeze the UI while the user is waiting but at the same time you probably don't want the user to click on something else.
If the delay is minor you can disable the UI and possibly display a "please wait" message, make sure those visible changes take place and then call your function normally.
Your UI is not freezing because of CPU processing so you should not use Task.Run. You are waiting for I/O to complete so you should be using async IO operations. See link below.
https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/async-scenarios