A start would be to purchase a replacement plug like https://www.homedepot.com/p/Leviton-15-Amp-125-Volt-Double-Pole-3-Wire-Grounding-Plug-Black-R50-3W101-00E/205165472 And then follow instructions like this Electrical Plug Replacement You will find three wires inside the power cord. The ground wire will either be in green insulation or uninsulated (other than the outer cover).
Have you tried replacing the battery? The Nexus 6 was announced in 2014 which is now well past the expected usable battery life. When the battery is very old, it will not be able to provide the extra power that the phone requires for the radio, CPU and screen. The result is crashes and power offs. You can confirm this by fully charging the phone, putting it into airplane mode and observing how long it stays on before reaching 80% and if it shuts down at that point.