What Happens to Tyrion Lannister?
At the beginning of the episode, Daenerys throws Tyrion in prison for treason because of his whole plan to help Jaime escape the city with Cersei. He defends himself by saying that his moment of weakness for his siblings is nothing compared to her choice to murder thousands of innocent people and throws his Hand of the Queen pin on the ground. ("I freed my brother, but you slaughtered a city.") Obviously Dany doesn't give a flying f*ck about that, to put it lightly, and has Grey Worm lock him up.
Tyrion is held in jail for what seems like weeks as a newly formed council (which includes the show's baddest b*tch, Sansa Stark) is created to figure out how to solve the problem of the rudderless leadership in Westeros, as well as Jon's decision to kill his aunt.
So, the council proceeds to elect Bran Stark the new king — yes, the same Bran Stark who hasn't said a single helpful sentence all season and who also can't produce any heirs — and Tyrion is named his Hand. Tyrion is the one who comes up with Jon's punishment — being banished to the Wall as a member of the Night's Watch — and then goes on to lead the small council for Bran.