If you have an Android phone, you can go to Security > Device administrator to disable all the apps, then install an anti-malware application and it should be deleted automatically.
For iOS based devices, connect the phone to PC and disable Internet, then restore it if you have created a backup and the malware should be deleted as well.
Support page for iOS devices: https://support.apple.com/en-us/HT201252