Harry and Ron didn't realise that they had just locked the troll in the girls bathroom, and therefore locked it in with Hermione who they were trying to save. Once they realised this, Harry and Ron ran into the bathroom to save Hermione.
Chat with our AI personalities
The Weasley twins and Ron came to save him when he didn't respond to any of the letters, and they came in their father's flying car and pried the bars off of Harry's window. Uncle Vernon caught ahold of Harry's ankle but fell out the window and Harry and the Weasley's spead away.
Filch found them trying to force their way through a door that unluckily turned out to be the entrance to the out-of-bounds corridor on the third floor.
To kill him. If one died the other would survive.
The spell that opens a locked door is "Alohomora!" The spell is taught during the first year of education at Hogwarts. The first book in the Harry Potter series -- Harry Potter and the Sorcerer's Stone -- chronicles Harry's first year. "Alohomora" is a charm and thus would've been taught by Filius Flitwick during Harry Potter's time at Hogwarts.
Harry thought Snape had tried to get past fluffy and used a troll to distract the school.