Each country is de facto represented by its respective public broadcaster. It is at easch broadcaster's sole discretion to determine who will represent their country at the Eurovision Song Contest.
There are three common ways to select a participant for the Eurovision Song Contest:
Through a televised national selection. Through one or more television shows, the public can take part in the selection of the country's representative. The most successfull televised national selection format is Melodifestivalen in Sweden, which features four live shows in different cities across the country, a second-chance show and a spectacular final;
Through a full internal selection. Artist and song are being selected internally by a committee appointed by the broadcaster;
Through a mixed format. Often, an artist is appointed by the broadcaster, while the public can help choose their song during a live television show;
The EBU strongly encourages participating broadcasters to engage the public with the selection of a participant for the Eurovision Song Contest.
You can find more information about national selection announcement on Eurovision.tv, as soon as the 2018 season kicks off.