A current carrying wire also creates its own magnetic field, so when it is placed in an external magnetic field then due to the interaction between the external magnetic field and its own magnetic field the wire feels a force.
The direction of the force depends on the direction of the current and the direction of the magnetic field.
The direction of the force on the current carrying conductor is obtained with the help of Fleming's left-hand rule. Fleming's Left Hand Rule states that whenever a current carrying conductor is placed inside a magnetic field, a force acts on the conductor, in a direction perpendicular to both the directions of the current and the magnetic field.