Hi
There are two possibilities here, depending on exactly where your problem lies:
a) Instrument tracks have a"Live mode", where the record button is Red, and a "not-live" mode (record button reveresed gray/red) where the Instrument channel is in "sleep" (my term) mode to save CPU power.
When "waking" or putting an Instrument channel in Live mode by playing a MIDI note, there is a small delay whilst the channel is put in Live mode.
You can put an Instrument channel into Live mode by a variety of methods, buy the easiest would be to send it any MIDI messages before trying to play something "realtime", by clicking on the R button in the track header, or by pressing play with the correct track selected.
b) More general latency is affected by the buffer size in Logic Pro X Preferences:Audio. Smaller buffer=lower latency but higher CPU load.
CCT