Emma Crossman, 21, was found dead at her home in Sleaford, Lincolnshire, on 15 January 2014. She had left a suicide note.
Lincoln Crown Court heard Amelia Caller, 22, of Great Hale, near Sleaford, was "obsessed and infatuated" with Miss Crossman.
She denies a charge of encouraging or assisting her friend to commit suicide.
Mark McKone, prosecuting, told the court there was no dispute that the defendant supplied a gas that Miss Crossman used to kill herself.
He said Miss Caller was pleading not guilty on the basis she did not think her friend would take her own life.
Mr McKone said: "The prosecution say that Amelia Caller assisted her in her suicide by supplying her with the... gas in an act of misguided loyalty."
The court heard Miss Crossman had a history of depression, self-harm and tablet overdoses.
Mr McKone said the two women had been close friends since they were teenagers.
The court heard they had exchanged Facebook and text messages discussing suicide.
In one message Miss Caller asked for one last day out together - "best friends having final fun day", Mr McKone said.
Miss Crossman's mother Sharon Parr told the court her daughter had taken an overdose of co-codamol in June 2013 but she thought this was a cry for attention.
She said after her daughter had split up with her boyfriend Emma and Millie "were seeing each other a bit too much".
But Mrs Parr said she did not believe her daughter wanted to die.
"Emma never wanted to die. She didn't," Mrs Parr said.
When asked about her daughter's relationship with Miss Caller she said: "Milly would do anything for her, she didn't even have to ask. Milly would just do it."
The trial is expected to last seven days.
A woman helped her friend to kill herself in an act of "misguided loyalty", a court has heard.