Your doctor may prescribe an antifungal cream, which you rub into your infected nails after soaking. These creams may work better if you first thin the nails. This helps the medication get through the hard nail surface to the underlying fungus. To thin nails, you apply a nonprescription lotion containing urea.