Reading. I find that reading a lot, especially one's own writing, helps :-) Also, I would suggest that every student take a few years of Latin, Greek and at least one foreign language from middle school on. That foreign language should be one that stems from a different root than one's own.
I don't use any of that stuff, but then again I'm an old guy who was well taught back when our public schools were a lot more functional. And English was my first language.
If I tried to write in some other language, I would need every electronic aid available...
I prefer natural intelligence, but if I have any doubts I'll look something up on the internet which I do occasionally.
Not for grammar, just spelling if I get a wild hair.
Then again my standards are low, I speak zero languages fluently ;)
I mostly rely on grammarly for english, but yeah, it struggles with mixed-language content.
Have you tried using it?
Grazie Pro plugin for IDE which is now also provided along with the JetBrains AI subscription https://plugins.jetbrains.com/plugin/16136-grazie-pro and it also has a browser extension