Chosen Solution
while the macbook was being charged the usb-c thunderbolt was snapped off please help how to replace the ports
If the external port is damaged you can replace the assembly! MacBook Pro (A1989, A1990, A2141, A2159, A2251, A2289, A2338 Mid 2018-2022) USB-C Board You will need to fully remove the logic board as the assembly screws are under it and you need space to slide it out.
Carefully unscrew the metal port cover and lift it off and then lift the connection, you’ll also need to remove the rest of the cables and screws.