For example, I'm a Support player.
My job (that I assigned myself) is to make sure that I keep the enemy as inconvenienced as possible, and my allies alive and strengthened.
Therefore, I'm usually in the middle or back of the group.
Healers and casters are usually in the back, because they need to get an overall sense of what's going on in the battle.
And finally, melee units and tanks are at the front, pushing the line forward and causing damage or distracting the enemy. This is where it's most dangerous, but also the most rewarding if you can stay alive.
As a tip, make sure to know when you move forward and when to retreat.
If you see 50% of your group fall, you may want to retreat back to a safe place.
Target an individual and stick with them, or look for players with low health to finish off.
There're lots of different roles to fill, all valuable to your group.
If you dont feel comfortable with melee fight in big group, try pick a target and use some ranged abilities, people are running around, there is no sticky targeting, so it may take a bit time to get used to it. Dont run with eyes closed swinging your weapon, and praying you may hit someone You will find yourself in middle of enemy group without stamina to block/roll/sprint, which means pretty much dead.
Good way is to practice on pve mobs, bit lower then you so you dont need to worry about healing yourself. Find groups of 3-6 and try focus on 1 all time. You will be surprised how it can improve your targeting skills if you are not familiar with this kind of gameplay/targeting.