Partial answer:
Based on the photo, you've removed and reinstalled the front wheel.
The two flanged nuts in your phot will be on the outside, then probably the washer, and inside that are the anti-rotation washers which have a raised section. Those are intended to fit inside the slot in your fork (also known as the dropout) and allow the motor to apply torque to the wheel rather than risk spinning on its own axle.
This is probably what has chewed up your wiring, as the motor's power cables will go in through the axle.
The axle in your motor should be stationary relative to the fork, and teh motor should turn around that fixed axle.
The two plastic-looking washers could be from anywhere - I can't tell what order they were in.
If you're not comfortable working with the three-phase AC wiring to your motor, there's nothing wrong with getting this to a Local Bike Shop for a repair.
If the axle's threads are torn off, then you might need a new axle from the manufacturer of your motor, and installation will require disassembly. If its the nut's thread, they should be a standard size and much easier to replace.
You might consider using threadlocker on marginal threads to try and make them hold, but that has to survive the torque from your motor, but also be light enough to undo the next time you need to change the inner tube. Don't use high temp threadlocker because the wiring will not survive the heat required to loosen it. At most use the "hand strength" locktite.
If your motor is just that much too powerful that it always wants to spin the axle, your bike might need "torque arms" to spread the rotational load to the fork rather than just in the narrow area of your dropouts. Example:
A motor of 250W or below does not need torque arms, but yours is apparently a 500W bafang and should definitely have torque arms, especially if you've turned up the power levels.