How did the nurse and friar lawrence have good intentions for Romeo and Juilet but everything went wrong
The nurse and friar Laurence both had good intentions for Romeo and Juliet in the same way that parents have good intentions for their children. The Nurse was more of a mother figure for Juliet than Juliet's own mother probably ever was. Juliet is from a wealthy family. She has her own personal nurse/servant. The Nurse has raised Juliet from infancy and done her feeding, bathing, clothing, etc. for all of Juliet's life. Juliet saw the Nurse as a friend and confidant as well as her servant. And the Nurse saw Juliet as more than her job. This relationship is evident in how the Nurse helps Juliet have her secret balcony meeting with Romeo. The nurse keeps watch, encourages her to pursue Romeo, and even makes dirty jokes about it. Then later, when it becomes clear to the Nurse that Juliet will never be allowed to marry Romeo, the Nurse does her absolute best to sell Juliet on the idea of marrying Paris. Deep down the Nurse might know that Juliet loves Romeo deeply, but the Nurse also knows that Paris will be a much better provider for Juliet. That and the family already likes Paris. The Nurse is definitely watching out for Juliet.
Friar Laurence is along the same lines as the Nurse. He is a counselor to both Romeo and Juliet. He advises them to take their relationship slowly, because is very much aware of the two families' antagonism toward each other. Friar Laurence agrees to marry Romeo and Juliet because he believes that they are truly in love, and he also thinks that the marriage may mend the relationship between the Capulets and Montagues. The reader never finds out if his plan works, because it's a secret marriage and nobody knows about it.
And that's when it all goes wrong. Juliet's father more or less tells Juliet that she will marry Paris later that week. Juliet consults with the Friar. He gives her a potion that will make her look dead. Romeo is then supposed to find her at the tomb, so that they can escape in love together. Romeo doesn't get the memo, thinks Juliet is really dead, kills himself, Juliet wakes up, sees Romeo dead, and then kills herself.
While the Friar and the Nurse may have had good intentions, ultimately their plotting and advice led to the deaths of Romeo and Juliet. The nurse's "marry Paris" speech only pushed Juliet away, and the friar's fake death plan definitely didn't work out as intended.