I think what the OP is asking is how to edit music that has already been recorded.
A quick list of the tools you have available (NLE, DAW, audio plug-ins, Beat Detective, etc.) and what you want to do with the pieces of music would be a help. Also, how much experience do you have with music - other than listening to it?
You figure out the length of the cue and the length of piece of music you have. Will you have to lengthen or shorten the piece?
Identify each transition point - intros, verses, choruses, bridges, instrumentals (if there are vocals), endings, suspensions, etc. - in the piece of music and figure out the lengths of each segment. There may be a "bridging passage" that you could double up (or cut in half) to add (or reduce) time. If you have an audio plug-in like Serato Pitch'n'Time you can change keys and speed up or slow down the audio (sometimes that extra two seconds on the end of a cue can make the difference).
The way that I do it is to run the song and put a marker at each transition point. Create a whole bunch of copies of the original audio and cut each of those up according to the markers. BTW, you have to be very precise with the lengths of the audio clips you are creating, they have to start and stop exactly on the "One" of the beat. You can then line up the "One" transients with the wave shape of the original track. Once you have the timing correct you fool around with crossfading so you don't have that obvious hard cut. I've done as little as a 1/8 beat to eight complete measures.
Just as with any other discipline it take a while to wrap your head around it. I'm here if you have any more questions.