What does it mean that an Ancient Blue Dragon's legendary action 'Wing Attack' costs 2 actions?
Doesn't a dragon get one action on its turn like everyone else, whether it's a multi-attack, casting a spell, or using its breath weapon?
The ancient blue dragon gets a turn like everyone else and can take any of the usual actions available for everyone (dodge, shove, grapple etc.) as well as the actions specified in the Actions section of its statblock, in this case with the following options available:
In addition to that, it has Legendary Actions, which is a special trait that grants it some extra options to perform under the listed circumstances:
The dragon can take 3 legendary actions, choosing from the options below. Only one legendary action option can be used at a time and only at the end of another creature's turn. The dragon regains spent legendary actions at the start of its turn.
Detect. The dragon makes a Wisdom (Perception) check.
Tail Attack. The dragon makes a tail attack.
Wing Attack (Costs 2 Actions). The dragon beats its wings. Each creature within 15 feet of the dragon must succeed on a DC 24 Dexterity saving throw or take 16 (2d6 + 9) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.
This means at the end of any other creatures turn, the dragon can choose to take any one of the three listed Legendary Actions, following their rules. You can think of the number of Legendary Actions as a pool of resources you can use to do extra things, which might cost 1 or more "points" to use.
In your example the Wing Attack (Costs 2 Actions) means the dragon has to spend 2 out of its 3 legendary actions to use this specific legendary action.
The ancient blue dragon gets "legendary actions", which are 3 extra actions per round it can take at the end of another creature's turn, in addition to the normal action it can take on its own turn.
The wing attack costs 2 legendary actions.
For example, a fight with the ancient blue dragon might go like this:
The Monster Manual explains legendary actions on page 11:
A legendary creature can take a certain number of special actions - called legendary actions - outside its turn. Only one legendary action option can be used at a time and only at the end of another creature's turn. A legendary creature regains spent legendary actions at the start of its turn. It isn't required to use its legendary actions, and it can't use legendary actions while incapacitated.
The reason for this is to make a single, powerful creature a viable fight against a whole group of PCs, and to make the battles against such legendary creatures more dramatic. Otherwise, the action economy often means that even if the creature's attacks or abilities are powerful, it can only use one of them per turn, and gets easily outmatched by the players taking many actions in return. With legendary actions - most monsters that have them get three -- they get to act again multiple times, if there are multiple players.
Some of these legendary actions may be a lot more powerful than others. To compensate for this, they can consume more than one of the legendary actions the creature can use each round.
In the case of the dragon, his legendary action are described so:
The dragon can take 3 legendary actions, choosing from the options below. [...]
Detect. The dragon makes a Wisdom (Perception) check.
Tail Attack. The dragon makes a tail attack. [dealing (2d8 + 9) bludgeoning damage.]
Wing Attack (Costs 2 Actions). The dragon beats its wings. Each creature within 15 feet of the dragon must succeed on a DC 24 Dexterity saving throw or take 16 (2d6 + 9) bludgeoning damage and be knocked prone. The dragon can then fly up to half its flying speed.
The Wing Attack legendary action is more powerful, as it can affect multiple player characters at the same time and knock targets prone, while the Tail Attack only hits one creature. To compensate, Wing Attack costs two legendary actions, instead of one.
In addition to taking an action on their turn, the dragon has the 'Legendary Actions' listed. These are special actions that are taken at the end of another creature's turn. They were created to give more of a 'boss' feel to encounters with these creatures since a lot of the time they will be facing the party alone. Rather than have the dragon do things only on their turn, they have these legendary actions that can be done at the end of any other creature's turn in the battle. That means actually that they cannot be done on the dragon's turn.
"The dragon can take 3 legendary action, chosen from the list below" means that the dragon has a pool of 3 legendary actions. They can take the same one three times, the fact that there are three choices is a coincidence. They regain the spent legendary actions at the beginning of their turn, so after the dragon's turn they always have 3 available to use at the end of other creatures' turns.
The "Wing Attack" is an extra powerful legendary action (since it can attack multiple players doing damage and knocking them prone, and also fly up to half it's flight distance), and thus consumes two of these legendary actions. It can only be used at the end of another creature's turn and only if the dragon has two legendary actions remaining, and it consumes two.