What is a device made from a coil of wire that carries a current and produces a magnetic field?

A magnet made by passing electricity through a coil of wire is called an electromagnet. Just the coil of wire is not enough. You also need a coil the wire around a magnetizable metal such as iron or nickel to actually become magnetic.