If you are trying to make an electromagnet, just remember these preventions:-
1. Circuit wiring should be good and correct.
2. The number of coils of the wire should be more (Approx. 80 coils).
3. Check whether the batteries are charged or not.
4. Any conductor of electricity should be taken on which you will coil the wire.