Use a legal music service that offers downloads
Open the app or website
Sign in to your account
Search for the song
Select the download option if available
Choose the audio quality if prompted
Wait for the download to finish
Open your downloads folder or music library
Play the file offline
Make sure you have permission to download the song
