Ceiling Fan Loose Wires
If you're just wanting to prevent shorts until you get it properly fixed, you could wrap each individual bare wire end with electrical tape. 

If you're looking to repair it, there should be wire nuts in the fan housing somewhere that fell off. Reinstall those, wiring matching wire colors together. If there are mismatched colors, post a pic &amp; someone will guide you.