Anet A2 3D printer suddenly will not home X and Y
I have experienced this a few times, usually this is related to the end stops.

If your end stops are somehow triggered (e.g. short circuit or cable broken; depending on the setup), the steppers will not home (as they think they are at the limits already) and only advance forward. Please look into the end stops of X and Y. Use a multi-meter to measure them and trigger them manually.

Alternatively hook up your printer to your computer with a USB cable and download a printer utility/application that can interact with the printer (e.g. Pronterface, Repetier-host, OctoPrint, etc.) and go to the terminal interface and send the M119 instruction to see the status of the end stops.