NSAIDs are by definition anti-inflammatory, so yes. But there are potential downsides to their long-term use, e.g. ibuprofen is linked with increased risk of heart attack and aspirin is ototoxic. Both can cause gastric problems.
I’ve found that turmeric extract in capsules can help quite a bit with inflammation and even brain fog
There exists a very safe alternative to NSAIDs, with quite a few other beneficial side-effects: