From the Super Mario Wiki, the Mario encyclopedia
Peppers are objects that appear in Super Mario Odyssey. They appear as multicolored, polygonal bell peppers that fall out of a hole in the wall and roll along a path on the way to the Cookatiel boss fight in the Luncheon Kingdom. If a Pepper knocks into Mario, it will break apart and drain one piece of his Health Meter. They also appear rolling on the Remote Island in the Lava, but are easier to avoid as they are not on a narrow pathway.