So my ceiling fan fell off. I’ve never worked on one so I was wondering if anyone can kind of give me guidance on how to fix this. Any help at all would be greatly appreciated.
Your ceiling fan was attached to an electrical box not rated for a fan and obviously not anchored to any framing member. (looks like it was an old works light box that was only clamped to the drywall.)
You will need to find if a framing member is somewhere close around that hole.
You could possible use an extendable bar fan box These can have the bar slipped into the hole and expanded between the joists or trusses or whatever framing members you have. The bar expands and grips the wood and you then attach the box to the bar. Get one rated for a ceiling fan.
Do all the work with the power to the fan off.
Of course the electric cable needs to be transferred to the new box and the fan disassembled to the point that you can get to the fan mount and start the process to hang the fan over again.