I see that the rectangle isn't made by using the shape option (no shape icon in the layers panel)(or you rasterised it).
I can only assume you made that rectangle by using the rectangle marquee tool and filled it (in this case with a gradient)
To change the color to a uniform color, hold ctrl and left click on the thumbnail. (you'll see the marching ants around the rectangle)
Select the wanted color with the color picker and make sure its set as foreground color.
Press alt+del to fill the rectangle with the choosen foreground color.
If you want a new gradient, double click on an empty space in the highlighted layer box and this will open the layer styles.
View attachment 82499