Sideloading would not fix built-in malware that cannot be removed. You would have to flash the device with a ROM like LineageOS, at which point you would have a FOSS (excluding drivers/firmware) system which you can (mostly) trust. F-Droid is a repository / app store of good free Android software apps that you can also mostly trust, which you could then use to add functionality.
But just sideloading would not do much.