Randomized blocks

Hi All,
How can I create a grid of squares (or any specific pattern) where the individual squares in the grid would randomly flash on and off? I hope the question isn’t too vague.
Can someone please help me out and explain what I need to do?

Thanks
Dave