Help oneself to (something)

To take whatever one wants or needs.

We went to the buffet table and helped ourselves to the food.