That problem is not with your playing.
Its the problem of your sound card.
Or rather, the problem with audacity.
All soundscards have latency, audacity however, does not correct for it.
For starters try to keep the sampling rate/frequency of audacity recording same as soundcard sampling freq.
And lower teh resolution as much as possible.
Eg - my Creative soundcard runs on 48000 Hz sampling rate. So i would keep my recording session on Audacity at 48000 Hz.
And resolution not more than 16 bits.
If you dont have any added soundcard, your in-built soundcard sampling will be @ 44100 Hz.
Check with these things.
You donít get what you deserve, you get what you negotiate.