Honestly, I think the most important thing is just consistent practice with a metronome.
If you're having trouble locking in with backing tracks or during jams with friends, there's a good chance it's just that the internal timing hasn't been trained enough yet. And to be fair, during jams, sometimes no one is really in time — so it’s hard to tell who’s off.
That’s why metronome work is so essential. It’s not flashy, but it really builds that solid foundation.