However the neutral and ground wires serve two distinct purposes. The neutral wire forms a part of the live circuit along with the hot wire.
A Kitchen Remodel 5 Kitchen Electrical Designandtechtheatre
Ground wire is hot. Cap the black wire off and cap the white wire off seperately. Sometimes the error is up or downstream of the outlet which requires more work to detect. You should not have a black ground wire or a white ground wire. Like the neutral wire the ground wire is also connected to an earth ground. Of the 2 only one is hot and its probably the black. Fixing a hot wire and a ground wire that are reversed is as easy as unscrewing and switching the wires on the receptacle and screwing them tight again.
This is a safety feature in case the hot or neutral wires somehow come in contact with metal parts. Disconnect the white and black wires from each other and from the ground wire on the outlet. But if you see three or four colors you can probably figure it out. Diagnose the error visually by looking behind the outlet or by inserting a three light voltage tester into the outlet and using it. Inside the can lights there is quick connectors that i cut and used wire nuts but i have rechecked this several times and everything seems correct. By convention the white wire is neutral the black wire is hot and a green or bare wire is ground.
In contrast the ground wire is connected to any metal parts in an appliance such as a microwave oven or coffee pot. Ground wire is hot drop ceiling carrying current. In breaker there is a shared bar with both ground and neutral wires connected. So if you see lots of different colors in an electrical box you probably need to call an electrician. But the first rule is there are no rules.