All kinds of alcohol (whether extracted from wood or other sources) is pure, not najis. So, the medicines, the perfumes, and the food containing alcohol are pure and can be used. It is also permissible to eat such food if the amount of alcohol is very minute.

https://www.sistani.org/english/book/46/2029/

(6th paragraph)

Does the last sentence mean that if food contains a small quantity of alcohol, I can eat it?

If so, what is considered a small quantity?

If there is wine/beer in food, it becomes najes and haram to eat even if the quantity is small. But if there is alcohol in the food, and the overall concentration of alcohol in the food is less than 2% (like vanilla being present in foods) it would be permissible to eat such foods.