There is no way to do it that is 100% guaranteed to be ban-proof.
First thing is first, make a full NAND backup using Hekate before doing ANYTHING. Then, read around a bit. First of all, know that restoring a clean NAND backup after you've been banned will not help you get unbanned. Also know that if you restore your NAND backup after playing online, your logs will mismatch what Nintendo has on file and could lead to a ban. One way to avoid this is by making a new NAND backup every time before you use CFW, only using CFW while offline, and then restoring that backup before playing online again.
For a long time that was how people managed to use CFW and remain unbanned. Now we have EmuNAND, or EmuMMC, which creates a virtual NAND on your SD card for CFW use. This allows you to switch back and forth between CFW and Online Play without constantly making and restoring NAND backups. Read up on it.
Now, like I said at first, there are no 100% guarantees. But quite a few people have used CFW on their SysNAND for the sole purpose of using save managers like Checkpoint or save editors like EdiZon. A few people claim that they've done this and have been banned, but it seems that for most people this doesn't happen. The main thing is to always stay offline while using CFW, and you should probably use it as little as possible. Launch CFW, edit your save, and then get out. Under no circumstances should you install any NSPs, NCAs, or NSZs (at least on SysNAND, if you're trying not to get banned.) For MOST people, this doesn't seem to be getting them banned.
Technically, you could use HacDiskMount and edit your saves without launching CFW whatsoever. Theoretically this would be safer, but it's also a lot more complicated and I've never seen a full guide on how to do it, although I've seen a few brief comments explaining how people have done it before. As far as bans, it should be less risky than running CFW, but you're directly accessing the Switch NAND over USB, which carries some risks as well. So be careful.
Finally, you should never ever cheat or edit saves in games that you play online. That comes with the most risk, although there are definitely people here successfully doing it in games like Pokemon Sword and Shield. Only time will tell whether they'll eventually be banned.
At the end of the day, it all comes down to your own personal risk / benefit analysis. How much is online play worth to you vs. being able to edit save files?