I learned to do my research up front when something looked/seemed suspicious.After my suspicions were confirmed, I’d ask him about what he said, giving him an opportunity to come clean.
Once he didn’t, I’d present the indisputable evidence. That was the only admission of guilt I would get, but I accepted it. So after I developed a pattern of confronting him with evidence, it became harder for him to automatically offer a lie as an explanation because there was a risk that I had done/would do more research to confirm the truth.
So at least at that point he would second guess his decision to just make something up.
At this point the habit gets disrupted, maybe not broken, but at least disrupted.
From there I began to weave into conversations (in appropriate contexts) that he has a demonstrated history of not telling the truth, just to reinforce that I don’t automatically buy everything he says now.
When I call him on a lie, he may try to deny it at first or shade things a little or offer a perfectly understandable explanation.