廃棄物 is made of 廃棄 + 物
apparently 廃棄する means "to abolish, to scrap, to repeal" (both physical things and stuff like treaties). So I guess we can think of
廃棄物 as waste (something to be disposed of) and
ごみ as trash/garbage/dust/dirt (something to be cleaned up and thrown away but not necessarily destroyed).
It also helps to check examples in the dictionaries to get a better feel of the usage. E.g. for 廃棄物 you find "factory waste", "radioactive waste", "polluted by waste", "reducing waste", while for ゴミ it's usually something related to household/street garbage and figurative meaning of "trash".