How do military decisions during crises impact diplomatic relations between countries?

The news about the Navy almost striking Pakistan during Operation Sindoor raises questions about how close military actions can influence or change diplomatic ties and peace efforts. I want to understand the balance between military preparedness and diplomatic consequences.