Troubleshooting small home made electromagnet
Just from a visual inspection of your photos, I think that some of the comments that you have received have sort of identified your problem.  This answer is just to add some more detail.

Your coil doesn't have enough turns of wire to generate much of a magnetic field.  In addition to that, the DC resistance of that wire is very low.  When you connect the coil to a 9V battery, the internal resistance of the battery is very high compared to the resistance of your coil.  This results in most of the energy being wasted inside the battery as heat.

One of the comments suggested using either an alkaline "D" cell or a "AA" NiMh cell.  Either would work much better than the 9V battery because the internal resistance of those cells is much, much lower than the 9V battery.

Just as a suggestion: if the winding on the fan where you are getting your wire from is still mostly intact, why not try connecting a "D" cell to the wires coming from the coil and seeing what happens?  There are many turns of wire on that coil and you know that the core is soft iron (or equivalent) - this would work nicely as an electromagnet.

If you want to make your electromagnet work better, you will need to rewind the coil with many more turns of much smaller wire.