The precise control of the polarization of the electromagnetic field in the optical range is studied. A numerical simulation was performed, which corresponds to the optical devices operating in the 650-800 nm range and does not present any obstacles for fabrication. According to this, the three-layer system based on metasurfaces was developed, which operates as a half-wave plate consisting of a metal-dielectric-metal structure and takes very small dimensions, more than 3 times smaller than the observed wavelength. This half-wave plate is reflective and exhibits almost ideal behavior with a spectral width of about 10 nm within 735-745 nm. The losses are negligible, and the amplitude ratio of the directly reflected components in almost the entire studied spectrum exceeds 90%. With a spectrum of about 100 nm within 650-800 nm, it is 99%. Also, the system has an advantage characteristic of metasurfaces: regardless of the angle of the incident wave with the normal, it shows high efficiency, and even when the incident wave is below 45o, the polarization conversion ratio (PCR) remains greater than 80%. The system has optimal geometric dimensions, which works especially well, but even if the dimensions change (due to fabrication defects), its effectiveness does not weaken. The proposed system can become a very promising optical device and be used to control the state of electromagnetic waves in the optical range.