It depends on the severity of whatever got you. It is possible the nasty can survive it. And Samsung doesn’t have the best record with Androids updates. And a factory reset is different from a nuke and pave on Android (iOS too).
But I am pretty paranoid. I don’t ever enter my credit card or banking info or even check my e-mail on my phone.
I think you may have to stop visiting sites that have know virus content like porn sites and pirate peer to peer sites.
Try putting Avast free for Android,