Ebert’s Hat puzzle with [7,4] hamming code

I’ve been researching Ebert’s hat puzzle and I keep reading that the 7 person case can be optimized using the [7,4] Hamming code. Can someone explain to me how the players could use Hamming codes to maximize their chances of winning?

=================

=================

=================