I'm a dog walker and most of the dogs I walk now just went through adolescence (lockdown pups coming of age). Whoo boy that was fun. Haha.
Loads of them suddenly behaved as if they didn't know their name / give two craps about listening.
100% foolproof method for me is making a quick "kissy" noise then giving them a mega high value treat - roast chicken, hot dog, that kind of thing. Now whenever I make the kissy noise, they immediately look at me regardless of what I'm offering them. Works with my own dog too.
Aside from that, you can work on eye contact and engagement.
Have a treat pouch on you throughout the day (or a toy - whatever your dog loves most). Whenever your dog looks at you without you asking, reward and give attention.
On walks, you can also build engagement my mixing up how you walk. You can be playful and say "go fast!" "go sloooowwww" "wait!" "this way!" and kind of jump around, have fun, change directions, change speed. Again, teaches dogs to keep their attention on you, because you are unpredictable and fun and spontaneous!
Once you've got more engagement, you can then start using your dog's name again to get their attention and then offering a huge fun jackpot reward. Otherwise they just learn to ignore their name when they don't feel like responding ;)