For module-based formats (IT, MOD, etc), these formats have proper native support for looping - use a module editor such as OpenMPT.
For waveform-based formats (OGG, MP3, WAV) etc, first, convert it to OGG, then add "LOOPSTART" and "LOOPLENGTH" metainfo tags, with the values being the position in samples to start the loop, and the duration (again, in samples) of the loop respectively. Most audio editing software should have some way to display positions in samples, but if all else fails, take the time in seconds and multiply it by the file's sample rate in Hz (eg, 33.18 seconds in a 44100Hz audio file would be 33.18 * 44100 = 1,463,238 samples).