>>723911967
Moonlord heavily encourages a flying mount like UFO or witch's broomstick.
You fly horizontally and kite vertically to avoid attacks and attack at range, and the fight becomes manageable.
This is only true for when you have aggro though, multiplayer is another matter.
It's also a good idea to have a spawn point with a Nurse NPC set up, but you risk getting your nurse killed by doing an emergency heal since Moon Lord always teleports to your position after a mirror warp.