Method 1: Lock Alpha and Manual Fill with Foreground Color
To quickly changed all opaque pixels of a layer to a color destructively, follow the following steps:
1: lock the alpha of the layer by clicking on the checkerboard icon in the Layers docker.

2: select the color you want to make the layer.
3: click on Edit -> Fill with Foreground Color on the menubar (keyboard shortcut: Shift+Backspace).
The entire layer will be filled with the selected color, but because the alpha is locked transparent pixels will remain transparent.
If you wish to make the entire layer a single color, turning transparent pixels into opaque, simply unlock the alpha and fill it.
Method 2: Color Overlay
The best method to make the opaque pixels of a layer into a specific color is to use the Color Overlay layer style effect. To do this, follow the following steps:
1: right click on the layer in the Layers docker to open its context menu, then select Layer Style... and activate the Color Overlay effect.
2: change mode from "Multiply" to "Normal," Opacity to 100%, and change the color to the color you want.

3: click OK to save the layer style effect.
Method 3: Fill Layer with Clipping Mask
A rather obvious but unexpectedly inefficient method we can use is to create a fill layer with a flat color.
1: add the fill layer above the layer you want to want to change the color of.
2: set the color to the color you want.
3: enable Inherit Alpha on the layer.
4: place both layers inside a group layer.
The reason why this method is inefficient is that in Krita a fill layer will fill the entire canvas with the fill of the fill layer, which is eats a lot of RAM and later will increase your file size compared to the Color Overlay method.
One case where you might want to use this method is if you are using gradients instead of flat colors.

Method 4: Vector with Clipping Mask
A final method you can use instead of a fill layer is a vector layer with a rectangle of a solid color that covers the entire canvas.
One way this method is useful is if you want to make the background of the whole image a given color using a layer and you don't want this to increase the file size too much. That's because a fill layer stores an internal transparency mask the size of the entire canvas, while a vector layer uses far less data to achieve the same effect. However, if that's what you want to do, there is yet another method that you can use.
Method 5: Background Color of Image
If all you want to do is change the background color of the image, simply click on Image -> Image Background Color and Transparency on the menubar, and select a different color.