Update data
UPDATE changes data that is already in the table. So unlike INSERT, which adds a new row, UPDATE keeps the row and changes one or more of its values.
The shape is simple: UPDATE table_name SET column = value WHERE condition. The SET part says what should change. The WHERE part says which row or rows should receive that change.
So the dangerous part is the same kind of danger as DELETE: if you forget the WHERE, MySQL updates every row in the table. That is the main thing to respect here.
The flow is the same pattern you already know by heart now: connect, write the SQL, run it, check whether it worked, close the connection. The only new part is that the query edits existing rows instead of inserting, selecting, or deleting them.