Strange applications are being installed sometimes
backup important data
do factory reset


if your device is rooted or the factory reset didn't work:


search for a complete factory image for this specific device model (also known as ROM)
flash it. (or if scared, find someone who is willing to do it)


Anything else would be a half measure, but if you really want to avoid resetting:


check if the attached Google account is compromised, because it's possible to install apps remotely via Google play.
Another possibility is some applications which got "device administrator" permission, so you can first find "device administrators" in settings and make sure that there are no device administrators.