If you want to fill a layer with the Foreground color, press Option-Delete (PC: Alt-Backspace). If you want to fill with the Background color, press Command-Delete (PC: Ctrl-Backspace). Now, what if you have some transparency on the layer, and you only want to fill the areas with pixels but not the transparent areas. The trick is to hold down the Shift key with the previous shortcuts to protect the transparency. So, filling with the Foreground color while protecting transparency would be: Shift-Option-Delete (PC: Shift-Alt-Backspace), and filling with the Background color while protecting transparency would be Shift-Command-Delete (PC: Shift-Ctrl-Backspace).
This tip originally published in Colin Smith’s “Photoshop Tips” column in the December, 2022 issue of Photoshop User magazine.