Turn guilt into tawbah quickly before Shaytan turns it into despair.
Stop the slip, make istighfar immediately, and reject the thought that Allah's door is closed.
Remove the nearest trigger you control and choose one replacement action for the next hour.
Make a specific tawbah dua and write one change that reduces the chance of repeating the same path.