Choose a piece of music with steady rhythm. Since a pre-recorded track can't accurately adjust for changes in tempo (especially those determined spontaneously by the soloist, such as rubato passages), only record a piece whose rhythm is steady, one where the soloist can easily follow the accompaniment.
Create a click track. This will be heard through headphones to guide the performers while they record the accompaniment and maintain a consistent tempo for the solo performer. The best way to do this is to connect an electronic tuner directly to a recording device using a phone jack patch cord; play back this track on a device that will allow you to hook up a microphone for each musician. If not, then make sure that all tracks are recorded by musicians listening to the same click track.
Record the accompaniment. If you have more than one performer, then determine a recording order for the instruments. Usually, it's best to start with the rhythm section (drums, guitar, bass and piano) or whatever instruments are responsible for laying down a steady pulse and harmony.
Include a section of the click track before the start of the music, if necessary. If this is a piece where the accompaniment begins before the soloist enters, then leave the click track off entirely, but if the soloist and accompaniment start together, the accompaniment track must contain a few measures of "count off" sounds before the piece starts. This should give at least one full measure, plus any partial measure counts that happen before the start if the music begins on a pickup note.