Ever sing a harmony and it's not quite in time? Or double a guitar part and it's a little sloppy? Let's look at a couple of ways we can fix things.
MPL Align Takes

Action List Menu
MPL Align Takes is a script by Michael Pilyavskiy.
With Align Takes, you choose a reference track, and the script changes the timing of other tracks to match the reference.
Align Takes does this by analyzing the reference track, putting stretch markers on the other tracks (called 'Dubs'), and moving the stretch markers to move the audio of the dubs closer to the timing of the reference track.
You can find MPL Align Takes in the Reaper Action List by searching for 'Align Takes. Double click on it, or select it and click 'Run'.
If you don't see the script, you can get it via ReaPack. It's free.

Align Takes Action List
On the interface, you'll see 4 buttons and a knob. Let's ignore the parameters and presets buttons for now. The first button is the 'Get reference' button. If you select an audio item and click 'Get reference', the script will analyze the timing of that item.
Then you can select the items you want to match to the reference item (select by clicking, hold down shift or ctrl/cmd to select additional items) and click the 'Get dub' button. This will put stretch markers on your dub items.
Use the knob to adjust the level to which the dub items will stretch to match the reference item.
You'd think it would make sense just to crank that knob up to full and match as closely as possible, right? Except, stretching and compacting audio can result in artifacts. The more extreme the change, the more likely there will be artifacts. Plus, small timing changes between parts are part of what sounds good about doubling. So, turn up the knob to taste.

Align Takes Front Panel
As far as the parameters go, I wouldn't mess with them. And it turns out the presets were made for specific individuals who sent the plug-in author tracks and asked him to tailor a preset for them. So they'll have limited use for you.

Align Takes Parameters
So, try the script on the default setting. If that doesn't do well for you, go to the presets and choose one that seems appropriate. If that doesn't work well, you can still have the script place the stretch markers. Then you can go in by hand and adjust to your liking.

Align Takes Presets
Aligning Takes With Stretch Markers
Another way to align takes is with stretch markers. Stretch markers do just what they say. They allow you to stretch or compact the audio. And you can place a stretch marker by clicking where you want it to go, holding down shift and then W. That creates a stretch marker.
It's generally good to place stretch markers at the beginnings of notes, or transients.
To get rid of a stretch marker hold down alt (that would be option on a Mac) and left click. That will get rid of the stretch marker.
Let's explore how to use them to align takes.
Surround Your Movement Points With Stretch Markers
When you move a stretch marker, it can stretch your whole audio item. If your playing was in time in some places, and a bit off in others, stretching can ruin the parts that are good. So it's a good idea to add stretch markers before and after the section you want to change, as well as adding them on any out of time parts.

Stretch Markers Added

Stretch Markers Adjusted
In the first image, notice how the first and last markers are very near the grid line, but the 2nd and 3rd markers are late? Placing the first and last markers allows you to shift the timing inside those markers without affecting the timing at or beyond those markers.
I think of the stretch markers on the on-time parts as anchors that hold the good sections in place.
See (in the bottom image) how the timing has improved for the middle two markers but has not shifted for markers 1 and 4?
Moving Stretch Markers
To move a stretch marker, simple click on it and drag.
Limitations Of Stretch Markers For Fixing Timing
Either of the above techniques will work well for making small timing adjustments in audio. But the more radically you stretch audio, the more likely you are to degrade the sound or produce artifacts. So do your best to get the performance as tight as possible. And if you need to stretch audio, do it judiciously 🙂