I am new to this so i am trying to make a electromagnet without having the short circuit problem so i was wondering if i could put a resistor in the middle of the circuit ?
You can use a resistor, or a light bulb in series with the coil. These will reduce current and magnet strength. More turns of higher gauge (thinner) wire will limit current by the inherent resistance of the wire, and give more turns, making the magnet stronger.