if an elected representative (MP / Councillor / MEP) resigns or dies while in office an election (by-election) is held as soon as possible to choose a successor
A by-election is an election that is held to choose a new member of parliament when a member has resigned or died. a special election to replace a politician who has left parliament or died general election