I moved your thread to the Plants section so you'll get better responses.
People on YouTube stated the Java Moss is so easy to grow, yet I have seen many people are having difficulties keeping them alive.
When you say "them", do you mean other types of moss? Or just Java Moss? Different mosses are similar but there are some slight differences in care. That said, I'll respond just regarding Java Moss.
I've tried to keep Java Moss in my tank and all failed. They just turning brown and melting away (rotten).
What are your water parameters? Lighting? Fertilizer? What have you dosed your tank with and what are you currently dosing it with, if anything?
I wonder whether the water temp will be a factor.
Yep. Mosses are cool water epiphytes. The warmer the water, the less likely one is to be successful with most mosses.
I ordered some Christmas moss online in the past and it arrived already showing in brownish color.
The seller who shipped it to you is to blame for that. Healthy moss wouldn't turn brown during shipment even after 7-8 days. That is, unless it cooked along the way or froze completely. Which... really is the seller's fault for not providing insulation. In the future if you ever see brown on moss, trim it away. If it's green, it'll grow. If it's brown, it'll spread (to more areas of the plant) and can kill off the rest.
Moss merely requires cooler temperatures (for the best conditions), decent flow - shouldn't be compacted at all, lower lighting, no heavy fertilizer dosing is required, kH and gH don't matter much, ignore pH, ammonia/nitrite/nitrate won't bother it, Excel will nuke it, some medications can be problematic. Other than that, Java Moss and other mosses really are as simple as people suggest.
I probably wouldn't try to keep it in water that's 81 degrees expecting it to thrive. But I'd probably give it a try. There's a chance it could be okay if there's enough flow and it's not constantly in high lighting. If you get some moss, maybe try a little bit of it to see how it goes instead of trying the entire portion you receive.
Just to give you a sense of how moss can grow in parameters ranging from 55 F, 4.9 pH/0 kH, 5 gH to 70ish F, probably 7 pH, 4-5 kH, 10-12 gH? Here are some photos from some of my shrimp and snail tanks through the years:
Note there was a heater in this Caridina tank above merely to prevent freezing.
For those alarmed by snails, here's a better look at what happens in some of my tanks during feeding time:
So there's rarely much in terms of anything that needs to be cleaned up. If a segment of moss begins to die, they clean it up quickly.
Most of the tanks in the photos have little to no additional fertilizer beyond what's available in a particular substrate. The only thing the tanks have in common: low light, good flow, cooler temps. Low light/low PAR tanks can also be pretty bright, as you can see.