There are a few possible reasons for the latency: Either it's because your computer is old and doesn't have enough ram/speed to process it fast enough or you can look into your software settings if you find something about latency and set that one to zero or even less than that (don't know if that option come with every programm, I only know it from Logic). Also if you have any plugins or effects (guitar effects, equalizers, compressor, limiter, etc.) that run real-time while recording you might be able to kill the latency (lag) by switching those off as long as you're recording stuff and apply them later, because they eat up a lot of your computers ressources, which results in the latency.