Choose or create a ringtone: You can either select a pre-made ringtone from the iTunes Store or create your own custom ringtone using audio editing software. Ensure that the ringtone file is in the correct format for iPhone, which is in the .m4r file extension.
Add the ringtone to your iTunes library: Connect your iPhone to your computer and launch iTunes. Click on the "File" menu and select "Add File to Library" or "Add Folder to Library" to import the ringtone file into your iTunes library. Alternatively, you can simply drag and drop the ringtone file directly into the iTunes window.
Edit the ringtone information: Locate the imported ringtone in your iTunes library. Right-click on it and select "Get Info" from the context menu. In the "Options" tab, you can set the start and stop times for the ringtone if you want a specific portion of the audio to play. Click "OK" to save the changes.
Convert the ringtone to AAC format: Right-click on the ringtone in your iTunes library and choose "Create AAC Version" from the context menu. iTunes will create a shorter version of the ringtone in the AAC format. If you don't see the "Create AAC Version" option, go to iTunes preferences, select the "General" tab, and click on "Import Settings." Change the import format to AAC and click "OK."
Locate the ringtone file: Right-click on the AAC version of the ringtone in your iTunes library and select "Show in Finder" (Mac) or "Show in Windows Explorer" (Windows). This will open the folder containing the ringtone file.
Rename the file extension: In the Finder (Mac) or Windows Explorer (Windows), change the file extension of the ringtone from .m4a to .m4r. Make sure to confirm the file extension change when prompted.
Add the ringtone to your iPhone: With your iPhone still connected to your computer, go back to iTunes. Select your iPhone icon in the upper-left corner of the iTunes window. In the sidebar, click on "Tones" under your iPhone's settings.
Sync the ringtone: Check the box next to "Sync Tones" and choose either "All tones" or "Selected tones." If you choose "Selected tones," make sure to check the box next to the ringtone you want to install. The "Apply" or "Sync" button to sync the ringtone to your iPhone.
Set the ringtone on your iPhone: Once the sync is complete, disconnect your iPhone from the computer. On your iPhone, go to the "Settings" app, then tap "Sounds & Haptics" (or "Sounds" in earlier iOS versions), and choose "Ringtone." Your custom ringtone should appear in the list of available ringtones. Select it, and it will be set as your new ringtone.