God took away king’s sleep so he could get reminded about Mordecai’s good deed for the king.
While the king planed to honor Mordecai, at the same time Haman planed to kill Mordecai.
Ahasuerus asked Haman for advice in honoring someone individually and since Haman assumed that it was meant for him, he gave the king his clever recommendation.
The king ordered Haman to do everything he recommended to Mordecai the Jew, so he did.
Haman got very embarrassed and went home to complain to his wife and friends, but then king’s servants came to get him to go to Esther’s banquet.