Praise be to Allah.
What is vomiting?
Vomiting refers to when food, etc. is expelled from the stomach outside the body.
Does vomiting break your fast?
With regard to whether vomiting breaks the fast or not, the ruling depends on whether it was done deliberately or not . If a person vomits deliberately, this breaks the fast and he has to make up that day. If he cannot help vomiting and vomits involuntarily, then his fast is still valid and he does not have to do anything else.
If a person needs to vomit because he is sick and vomiting will help him to recover, then it is permissible for him to do that, but he has to make up that day after Ramadan, because Allah says (interpretation of the meaning):
“and whoever is ill or on a journey, the same number [of days which one did not observe Sawm (fasts) must be made up] from other days.” [al-Baqarah 2:185]
Vomiting a little while fasting
According to the correct scholarly view, it makes no difference whether the amount of vomit is great or small. If a person vomits deliberately and only a small amount comes out, the fast is broken.
It says in al-Furu’:
“If a person makes himself vomit and vomits anything, then his fast is broken, because of the report of Abu Hurayrah: “Whoever cannot help vomiting does not have to do anything but whoever makes himself vomit deliberately has to make up that day.” (Al-Furu’, 3/49) This hadith was narrated by Abu Dawud, 2380; al-Tirmidhi, 720 – he said the scholars follow this. It was classed as sahih by al-Albani.
Does spitting break your fast?
But there is a difference between spitting and vomiting. Spitting and hawking, etc. do not come from the stomach, so there is nothing wrong with expelling that matter. But vomiting comes from the stomach as explained above.
For more, please see this answer: What Breaks Your Fast
And Allah knows best.