Choose an audio file you want to use
Make sure the file is in a supported format like MP3, M4A, or WAV
Trim the audio to 30 seconds or less
Convert the file to AAC if needed
On Mac, open Music and use File > Convert > Create AAC Version
On Windows, use iTunes to create an AAC version
Rename the AAC file extension from .m4a to .m4r
Connect your iPhone to your computer
Open Finder on Mac or iTunes on Windows
Drag the .m4r file into the Tones section or sync it to your iPhone
On iPhone, go to Settings
Tap Sounds & Haptics
Tap Ringtone
Select your custom ringtone
Use GarageBand on iPhone to create a ringtone directly on the device
Export the GarageBand project as a ringtone
Set the exported sound as your ringtone from the ringtone list
