The plural 'costs' is certainly connected with court action, but not restricted to it.
I wanted to appeal the court decision, but decided not to because the costs involved would be enormous.
The court decided in favour of the plaintiff, who was awarded 45 euros damages plus 450000000 euros costs. (Costs are the expenses incurred in bringing the court action, layers, witnesses etc.)
I planned to build a house, but decided that the costs involved would be too much.