I have a bunch of dead leaves from a plant that has white flies. Can I use them for compost?
Whiteflies commonly encountered, such as Cabbage whitefly (Aleyrodes proletella) and Greenhouse whitefly (Trialeurodes vaporariorum), are sap-suckers. Once plant material is dead they will have nothing to feed on so will either move on or starve if they can't escape. They will not harm your compost. It is important to make sure that you thoroughly compost plant material before use (for all sorts of reasons) but in this case, there may be eggs on the leaves which could hatch.
As mentioned, the winged stages of their lifecycle will try to fly away, so it may hamper your efforts in controlling their numbers if they are not killed. Horticultural soap diluted according to instructions and sprayed on affected plants can be quite effective but will require treatments every couple of days. Due to their fast reproductive rate, they can develop resistance to chemical controls quite quickly, so these should be avoided. Material that is to be composted can be submerged in water with a little dish soap or horticultural soap for a few hours first to kill any individuals remaining on the leaves.