We use by + noun to talk about the way we do something or the way something is done:
- I like to make pizza by hand.
- Those donuts are made by machine.
- The calculations are performed by computer.
We use by + gerund to talk about the action we take in order to do something:
- I make the dough by mixing flour, yeast, and warm water.
- Those donuts are made by pouring the ingredients into the machine.
- The calculations are performed by programming the computer.
We use with + noun to talk about the, ingredients, tool or instrument we use to do something:
- I made the sauce with fresh tomatoes, basal, and garlic.
- I forgot to bring a spoon, so I ate my yogurt with a fork.
- You can move the objects on the computer with a mouse.