What should I do if my toenail fell off due to a fungal nail infection?

Antifungal. With the nail off i would start to use a topical antifungal on the nailbed.
Wait. If you nail falls off due to a presumed fungal infection, see your physician. If it is indeed a fungal infection, you may be treated to help eliminate the infection. The nail will most liekly regrow. It can take 6-12 mos for a toenail to regrow. Depending on how much damage was done by the infection, the nail may or may not regrow normally.