Vegetarians need to since B12 is mostly found in animal products.
Dairy is sufficient if you aren't vegan, particularly yogurt.
But, if you're a vegan, Marmite and Mushrooms are your best bet.
They don't have a ton though, Marmite you'd have to eat at least once a week, mushrooms every 2-5 days depending on which study you look at.
If you're a piscatarian(vegetarian except fish) you're fine because fish has tons of the stuff.
Personally, I'd say if you're vegetarian for health reasons, you should just eat some fish once a month or so and it'll be enough.
If it's for moral reasons, I hope you like mushrooms