While some people believe onions can help relieve a cough, there's no scientific evidence to support this.
According to the reference article "Cut Up an Onion to Relieve Your Cough (or So People Say)", some individuals swear by the strong vapor emitted when an onion is cut, claiming it helps relieve a cough. However, the article clearly states that "there isn't any science behind it". In summary, the perceived benefit is anecdotal and lacks scientific backing.