This is why you should only use official Apple or certified MFi charging cables for your iPhone
Apple certified third-party chargers will have one of these MFi badges on the packaging
At this point, the iPhone 15 Pro Max in the photo could be unsafe to use although it could still be charged using a MagSafe wireless charger. But the part of the charging cable still stuck in the phone (we don’t know if the heat welded it to any internal parts) still looks pretty dicey at best and to reiterate, we’d bring this unit to the closest Apple Store or certified repair shop before fooling around with it.