Mirror modifier problem

If I use the mirror modifier then the mirrored half is tilted and sometimes not mirrored on the axis I click on. Why?

Check where the objects centre is.
(That little pink dot)
You can change it in object mode, using the transform menu.
I’m not sure what all the options are, but I mainly use Centre Cursor.
Moves the objects centre to where the 3D Cursor is

Shifting the object’s center in any way does not help.

it would be much easier to see if you post the .blend file

Press Ctrl+A in Object Mode and select the first option.

if the object is rotated at all it will move the mirror axis.
cntrl-a “scale and rot to obj data” makes it so all the scaling and rotation is applied to the data, thus re-aligning the object center

Ctrl+A and the first option worked. Thank you very much.