Barracudas can and sometimes do attack humans and bit them when you get close to them.
But the attacks from Barracudas on humans are rare, although bites can result in lacerations and the loss of some tissue.
Most Barracudas will leave humans alone but you should still keep your distance from them and if you know Barracudas are in the water you should really just avoid the water.
Barracudas are scavengers, and may sometimes mistake snorkellers for large predators, following them hoping to eat the remains of their prey.
Also some swimmers have reported being bitten by barracudas, but such incidents are rare and possibly caused by poor visibility.