I don't think Messi will just leave football... The World Cup is three years away, that's not much time... Although it would probably be nice for him to retire from football after his team won the cup last year... If Messi stays in the national team, it's not certain they can win in 2026... And this championship will definitely be his last... I can't assume anything about Ronaldo... He was going to leave a long time ago... But he still plays every time...
Messi currently has a contract with Inter Miami until December 2025... that sounds like he will retire by then, and not play the world cup in 2026.
Basically it looks like he's just getting as much money as he can right now and then ride into the sunset.
Maybe he will just continue doing ads, but I reckon he won't be playing professional football in 2026.
If Lionel Messi wanted to get as much money as he can while he is still active in the sport then I he could've joined the team where CR7 is with because that contract was worth a staggering $450 Million compared to what Inter Miami gave to him which is only $60 Million per year and that will only last for two years.
So, that's not really the case and while searching for the answer of that question, it seems that Messi just wanted a calmer life and a lot of time with his family.