Smart phones can get viruses and other malware just as other computing devices can such as PCs, tablets, laptops, etc.
You need an anti-virus program on your phone to catch viruses and other malware and to remove that malware. The anti-virus program will work similar to the programs that run on your larger devices. Remember that a smart phone is just a physically small computer and has more power than computers that were on our desks not that many years ago.
Most of the companies that make anti-viruses for the larger personal type computers also make anti-viruses for you smart phone. Just as in larger devices some will work on some types of operating systems and some on other. Remember on your smart phone it is typically running one of two popular operating systems; Android or Apple iOS. A few people do use Windows phones running Windows but the smart phone market Microsoft has never made inroads.
There are also some antivirus programs only made for smart phones with Lookout probably the most popular.
Avast, TrendMicro, Norton and others make anti-virus apps for phones. Some you need to pay for and some are free. I use the Avast program on my PC and laptop and the Avast app on my phone, which are all free.
The other important thing is make sure the apps stay up to date and also have current virus signatures or base file.