This exclamation is said immediately after experiencing pain or physical discomfort.
Ouch! That needle hurt.
Ouch, I hit my knee on the table.
This informal noun use describes something that causes emotional, financial, or physical discomfort.
That repair bill was a real ouch.
The criticism added another ouch to an already difficult week.