This problem is usualy caused by moisture in the interior fuse box or Generic Electronic Module (GEM, attached to the top of the fuse box). I have had some sucsess with just drying them out (put a small fan on the floor blowing up on the fuse box), But if there is corrosion inside the fuse box you may have to replace it.
Now the the real problem has to be fixed Ford F series trucks have an ongoing problem with leaking windshields you need to get the windshield resealed to prevent this problem from happening again. A professional glass installer should be familiar with this problem and correction.
Sometimes these two components become so corroded that drying does not work so it becomes necessary to pull the fuse box and GEM down and open it up, to clean the connections or replace one or the other. Always check the plug connections for water before replacing.
If that does not work you will have to pull it down and clean or replace it and the GEM module.
Make sure you disconnect the battery before attempting to unbolt the fuse box (if drying does not work)