Maxwell's corkscrew rule:
If we imagine driving a corkscrew in the direction of a current, the direction in which we turn its handle is the direction of magnetic field.
This rule is used to find the direction of magnetic field if the direction of current is known.
When electric current flows vertically upwards, the direction of magnetic field produced is anticlockwise. Similarly, when electric current flows vertically downwards, the direction of magnetic field is clockwise.