In this paper, the cooperative electronic relay in device to device (D2D) communication system will be used which is not clarified until now. A scenario in our work will be made by using three types of cooperative diversities together that are compress and forward relay, decode and forward relay (DF) and amplify and forward relay (AF). Numerical results show that, the D2D outage probability of the proposed scheme is lower than that of the traditional relay transmission, which is further reduced with an increasing number of the electronic relays, therefore utilizing number of the electronic relay equal to 8 relays will reduce the outage probability by 0.0024 than using previous relays channel. Moreover using our proposed relay at SNR equal to 25 dB resulting in reducing BER by 4 dB. Moreover, the comparison between using proposed relay and previous research like AF relay with variable gain and DF relay will be carried out, where outage ratio will reduce to 15 dB using our proposed the electronic relay.