An electromagnet, any size, uses a ferromagnetic material (soft iron or silicon transformer steel or ceramic ferrites) for the core and an open (air gap) magnetic circuit path. Wire is wound around the core to create the magnetic field produced by the electromagnet.
The core intensifies and confines the electromagnetic field within the core except on the ends where the field "escapes" into the surrounding medium, usually air. The air gap allows the field to attract nearby ferromagnetic objects. Every electromagnet has two magnetic poles between which the magnetic field propagates. Most electromagnets use a ferromagnetic circuit to bring one pole physically close to the other pole, the magnetic field then being mostly confined to the volume between the two poles. A horseshoe magnet is a common example. This is not absolutely necessary: the poles on either end of the core can be left open, with considerably reduced magnet field intensity at either pole.
If you need a really tiny electromagnet you might try disassembling things that have tiny parts. A battery powered wristwatch comes to mind... surely there is an electromagnetic component in there somewhere! You could possibly wind your own electromagnet, as
@Alec_t suggested using a length of soft iron wire, such as florist wire (green painted, soft iron wire used to tie up flower arrangements). Leave a generous length in addition to whatever length you make the coil so you can fold it back to serve as the other magnetic pole, cutting it off even with the other end.
There are so-called "pot cores" that come in two parts, one of which you will discard and the other you will use as an electromagnet having a magnetic core and one magnetic pole in the center, surrounded by a cup of magnetic material for the other pole. The outer rim of the "cup" is one magnetic pole and the center stem on which the coil is wound is the other magnetic pole.
Normally the other half of a pot core is placed over the stem half to form a closed magnetic path with minimal external magnetic field. For your electromagnet application you would not use this piece. Problem is, I have never seen a pot core made in a 2 mm diameter size. You
might be able to start with a 2 mm diameter solid ferrite, or soft iron, rod and machine an internal annulus to form a post on which to place your coil. Perhaps use a CNC water-jet cutter or CNC wire EDM for this. Ferrite is a brittle ceramic and otherwise difficult to machine, but the small dimensions present a challenge even if soft iron is used.
You want to compromise with the diameter of the internal center post, leaving enough to allow a coil to slip over it easily (coil is wound externally before being placed on the center post) but also large enough to form an effective magnetic pole with the cup edge that will attract whatever small ferromagnetic objects you are trying to attract. It would help a lot if you would tell us what you are trying to
DO.