Gribov–Zwanziger prescription in Yang–Mills theory improves the infrared dynamics. In this work, we study the static potential of a heavy quark-antiquark pair with the HTL resummed perturbation method within the Gribov–Zwanziger approach at finite temperature. The real and imaginary parts of the heavy quarkonium complex potential are obtained from the one-loop effective static gluon propagator. The one-loop effective gluon propagator is obtained by calculating the one-loop gluon self-energies containing the quark, gluon, and ghost loop. The gluon and ghost loops are modified in the presence of the Gribov parameter. We also calculate the decay width from the imaginary part of the potential. We also discuss the medium effect of heavy quarkonium potential with the localized action via auxiliary fields.