It is impossible to completely eliminate the sound coming from a generator, since you can’t completely enclose it because of exhaust ventilation and airflow. However, you can reduce the noise by a great deal by building a soundproof box.
Hard materials such as concrete, metal, or wood can increase the noise – especially if they aren’t on a flat surface.
You can place the generator on a soft surface, like grass, or to put the generator in a quiet box to help reduce the noise.
You can use Mass Loaded Vinyl, making the wall denser by 50% and decoupling your generator from the floor and dampen vibrations.