In Game of Thrones' S08E06, we see Bran elected king in what seems like an unprecedented event. Taking into account the books, elections have happened before in the form of The Great Council.
Does the TV series ever refer to those?
There has not been a Great Council until season 8.
Although, according to this AWOIF page, there's a variant called Kingsmoot, in here, the Ironborn chose a new Iron King. This briefly happened when Yara, and Euron wanted to be the Iron King.
In the books however, there has only been mentioned.
Catelyn suggests to Renly Baratheon that he, his brother Stannis, and Robb Stark, who have all been crowned during the War of the Five Kings, should set aside their claims and call for a Great Council to determine who should rule. Renly laughs at the suggestion.
Same page as the first link.