When a phone's battery overheats and expands, it poses a significant safety risk, including the potential for fire or the battery bursting. The first and most critical action is to turn off the device to prevent further chemical reactions within the battery that could exacerbate the situation. Turning off the phone halts its operations, minimizing the heat generation and reducing the risk of further damage or danger. This is a precautionary measure to ensure the user's safety and to prevent any additional harm to the phone itself. It's important for the user to not attempt to charge or use the phone in this condition and to seek professional help or replacement of the battery or device as needed.