It would be helpful if you provided some of the information requested, such as where you do see this message. Descriptions of other "weird stuff" might also help.
But frankly my advice would be to reflash the device completely, i.e. find the stock firmware at Sammobile.com and follow the instructions to install that (it probably involves a computer and the Smart Switch app these days, I'm not up to speed with Samsung's tools). You'll need your full model number, not just "Note 10", but the phone's Settings can tell you that. This will completely overwrite your system software with a new set, so if anyone (e.g. a previous owner) has modified the system this will undo it. So once you've done that you know that there are no nasty things added to the phone's system.
A factory reset does not do this: all that does is erase user-installed apps and app data, and does not alter the system software in any way.
Note that this might not remove that message. If the phone has previously been modified the Knox "e-fuse" will have been tripped, and reflashing the phone does not reset that. So some record that the phone was once modified will remain, and not being a Samsung expert, and not knowing for sure what is producing this message (see my first request here), I don't know whether you will still get the message about custom software even though it will no longer be true. But if you reflash the device yourself you will know for sure that there are no mods present, which is why I'm suggesting that.
Also if you think someone might have access to your system you need to secure your accounts (change passwords, enable 2-factor authentication, etc). And don't do that using a device which you think might be compromised, for obvious reasons.