First of all, you need to plug your iPhone into your computer using the USB cable that comes bundles with your smartphone.
After you plug in the device, you will automatically see iTunes launching itself. If it does not, then you can do it manually from the installed programs on your computer.
After iTunes is launched, click on Library button which is located on the top left hand side of your screen. Clicking the button will show you all the music files you have synced with your phone.
Right click on the file you want to create a ringtone from, and click on Get Info. Click on the Options tab from the menu that appears afterwards.
Enter the start and stop time for the track. Make sure its interval does not exceed 30 seconds. For example if you want to start from 0.00, then the end time must be 0.30. Also, make sure you check both Start and Stop checkboxes.
Click OK to return to the Library. Then right click on the song name once again and click Create AAC version. Once that is done, locate the file in your folders and save it somewhere else.
Delete the 30-second version of the song from your iTunes library. When it prompts, click Keep File.
Now go to the AAC file you saved in a different location in your computer. Right click it and change its extension from .m4a to .m4r and save it. In order to change the extensions of the files, you will need to uncheck the “Hide file extensions for known file types” option from your windows folders settings.
Once you rename the file, double click it and it will launch itself automatically in iTunes. Sync it to your phone and you are good to.