If the malware is on a app. You can safely remove it. Head over to Device care and do a scan. If you managed to find it. You can can safely delete it. But if not your last option is to factory reset your phone as this will fully get rid of the virus.
Its probably just apps running in the background slowing your phone down. Go to settings, device care, battery then battery usage limit and select deep sleeping apps. Put all the unused apps to deep sleep
I second what others said. Likely NOT a virus. Run a malwarebytes scan. Or fully reset the phone deleting everything using the factory reset option. The a51 isn't the fastest of phones anyway dont expect too much from it.