Set the foreground to gray, any gray. Go to the edit menu and fill that with the current foreground. Why use gray, well, it works well with the color Photoshop brick fills and randomization (full range)
Before you can define that preset, you need to make some subtle variation as if you define a 1000 x 1000 gray image then the result will be a 1 x 1 pixel pattern (that is the way the application works). You need to add some subtle variation to the image and that can be done by adding a small square of slightly different gray.
Generate a square selection using the rectangular marquee tool (hold the shift key down as you draw the selection) if you want your color design to be squares, if you want it to be rectangles, use the rectangular marquee tool to make a selection. Go to the foreground color and change the brightness by 1 and then go to the rectangle tool and set to pixel mode. Click inside the selection with rectangle tool and enter 1 and 1 as the height and width.
Now go to the edit menu and define pattern and you will now see you have a tile size of not 1 x 1 but whatever size the selection is. De-select the selection before you continue https://youtu.be/zLeKfd_d14o
Go to the edit menu and fill and contents set to pattern and select the pattern you have just created and then set the scripts to ON and select the brick fill. https://youtu.be/cJgyx9msNhY
Set the scale as required (note that the preview will never match the preview) and then set the spacing to 0 and offset to 0 and angle to 0
Set both of the hue / brightness etc settings to 1 (max). Press return. You may have to re-apply it a few times to match the scale etc to the design that you want.
You should now have a selection of yellow / red / green etc rectangles
You can also apply adjustments to the artwork or an adjustment layer to modify the design such as using the image menu and adjustments and black and white or HSL or LUT (destructive effect) or use the layer menu and new adjustment layer and HSL etc (non destructive) to create extreme or subtle changes to your artwork. https://youtu.be/WQI9556_DKU