Cyclingtips has a nice deep dive into this, albeit it appears more focused on road bikes. The author’s take is that you can simply wipe the chain off after every ride without degreasing, then re-lubricate occasionally. The author believes that if you just use degreased on a rag, then all you get degreased mixed in with the lubricant, so your chain is actually less lubricated.
MTB and gravel bikes will get more dirt intrusion into the rollers, that road bikes, but even road bikes will get some. That dirt forms a grinding paste which increases chain wear. Thus, many people will benefit from getting an on-bike chain cleaner. This houses brushes and a lubricant reservoir (NB: dilutes dish soap will suffice). You can run your chain through it, and it will get it cleaner that simply wiping it off. You would then let the chain dry, then re-lube.
Naturally, there are more thorough methods that are detailed in the article. You should not allow yourself to be intimidated by them. Simple methods are enough for almost all riders. But yes, you could remove the chain, soak it in solvent (perhaps in an ultrasonic cleaner), then lubricate it or dip it in wax. But you do not have to do this.