Gertrude throws flowers to Ophelia during her funeral and states those flowers we supposed to be used for her wedding and not funeral.
As Laertes and Hamlet are having the sword fight, Hamlet is wining and the queen drinks out of the poisoned drink.
The queen falls and dies because of the drink and before she died, she states she had been poisoned. At that moment, Hamlet is hit by the poisoned sword and there´s an exchange in swords which leads Laertes to also get hit. That leads to the death of both the guys and Hamlet forces Claudius to drink from the poisoned drink and they all die.