To eliminate bad breath while consuming onions, you can consume apples.
Fresh apples contain enzymes that have ingredients like natural deodorants. Therefore, it can act against the onion odor produced by cysteine sulfoxide in onions. The presence of this enzyme is visible from the change in the color of apples that become brown when peeled. You are advised to eat apples directly after eating onions or onion-based foods, in order to prevent or neutralize the smell of onions.