Mercutio serves as a friend to Romeo by being a counselor, albeit a very comical one. We first meet Mercutio when he and Benvolio are trying to persuade Romeo to crash the Capulet ball and Romeo is wailing about how heartbroken he is. Mercutio's response is to say,
"If love be rough with you, be rough with love; prick love for pricking, and you beat love down" (Act I, Scene 4).
In other words, he is counseling Romeo to fight off his negative feelings, rather than give into them.
Another way that Mercutio serves as a friend to Romeo is by remaining practical and criticizing Romeo for his wild, untamed emotions. In this same scene, when Romeo continues to be downcast and to refuse to join the fun, Mercutio offers to rescue him from his low feelings, saying,
"we'll draw thee from the mire of this sir-reverence love, wherein thou stick'st up to the ears."
We also see Mercutio tell Romeo he is speaking nonsense to worry so much, especially about his prophesying dream that something bad would happen that night, when he says,
"True, I talk of dreams, which are the children of an idle brain, begot of nothing but vain fantasy."
In saying this, Mercutio is telling Romeo that he is being idle and indulging in fantasies.
Mercutio went with Romeo to the Capulet's party to find a girl way prettier than Rosaline.
Mercutio and Tybalt fight each other and Mercutio lays in a pool of blood. Romeo to avenge his friend's death kills Tybalt, who then is banished from the city of Verona.