Overdub latency workaround needed

Using Audacity 2.3.0 on MacOS Sierra 10.12.6:

I’m having trouble getting my overdub to align with the first track. I record one instrumental track. Then using headphones, I create the second instrumental track. Although I am playing in time with what I’m hearing, the actual recorded track has a latency of ~.3-.4 seconds. How do I time-shift the second track so that it correctly aligns with the first? I’ve scoured the Manual and the Forum, and can’t find an answer, so if this has been addressed before, please accept my apologies for my failure to search correctly. And TIA for any help.

This is the page you were looking for: https://manual.audacityteam.org/man/latency_test.html

Tip: The front page of the manual (https://manual.audacityteam.org/) is loaded with key words. Searching the front page for the word “latency” would have located the link.

To strictly answer the question, use the Time Shift Tool (two sideways black arrows) and shove the track into alignment.

To fix it permanently, record your headphones by shoving them against the microphone. Play that back and measure the amount the two tracks miss. That’s the compensation to add to the value in Audacity > Preferences > Device > Latency.

Try it again. If you use the click track or drums as the backing track, this is a lot easier.