A microphone, processor, amplifier and a large speaker. Record the noise, the processor turns everything 180 degrees out of phase from the recording and plays it back through the speaker at the same spl level.
Very tough to do real time - and costly The processing required to distinguish the 'bad' noise from things like speech, intercoms, etc. is pretty in depth.
.
Auto manufacturers have been working on it for years for in-car applications.