You decide the order
Xanathar's Guide to Everything, pg. 77 gives guidance on adjudicating situations when things are happening simultaneously:
Simultaneous Effects
Most effects in the game happen in succession, following an order set by the rules or the DM. In rare cases, effects can happen at the same time, especially at the start or end of a creature’s turn. If two or more things happen at the same time on a character or monster’s turn, the person at the game table — whether player or DM — who controls that creature decides the order in which those things happen. For example, if two effects occur at the end of a player character’s turn, the player decides which of the two effects happens first.
It gives the player whose turn it is advantage, and ensures more fun, because it favors the current player.