In newer Android Studio versions (to date March 2025 its Merecat)
you can go to Tools > SDK Manager
and in the "SDK Location:" search bar on the top click the highlighted "Edit" text, that will open a download window, just click "Next" and that will download and set the correct path to the SDK.