Download and install the Audacity program to the PC.
Setup the guitar and amplifier with the desired sound output settings, and then connect the amplifier to the computer's recording input jack by using a guitar cable and a coaxial-to-3.5mm converter. Connect the amplifier output to a mixing board or equalizer before connecting that device to the computer, for the best results.
Open the Audacity program, hit the "Record" button and play the guitar at the volume you intend to record at. Adjust the microphone volume slider at the top of the window so that the volume bars fill approximately 80 percent of the gauge at loudest playing. After adjusting, hit "Stop" and press the "X" next to the recording track to delete it.
Select the "Click Track" option from the "Generate" menu, enter the beat tempo you want to record at, select the beats-per-measure to match the music's time signature, enter a number of measures value that is three or four times larger than the number of measures in the loop, and press "OK."
Click the "Record" button and count off a measure or two before starting to play in sync with the click track. Play the section of music you want to loop several times over and hit the "stop" button.
Listen to the recording and select the best performance of the desired loop.
Click the mouse cursor at the starting point of the first beat in the instance of the loop you want to use. Drag the mouse to highlight the rest of the track before that instance, and press delete. Repeat this process for the starting beat of the instance after your selected instance, except highlight everything on the track after the selected instance, and press delete.
Press the "X" icon on the click track -- and any other tracks except the loop -- to remove every recording track except the loop.
Click the "File" menu, choose "Export as WAV," choose a location to save the loop, enter a name for the file, and click "Save".
Import the loop into your audio editing software.