How to label cells in a square grid

Here you have something to start with:

\documentclass[tikz]{standalone}
\usetikzlibrary{matrix}

\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes, nodes={minimum size=1cm, draw, anchor=center}, row sep=-\pgflinewidth, column sep=-\pgflinewidth](mygrid){%
R & B & W & G \\
B & W & G & R \\
W & G & R & B \\
G & R & B & W \\
};
\end{tikzpicture}
\end{document}

enter image description here


Just for fun. Using some modulo arithmetic.

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}
 \edef\lstM{"R","B","W","G"}
 \path (-1.5,6) coordinate(m10);
 \foreach \X in {1,...,8}
  {\foreach \Y in {1,...,8}
  {\pgfmathsetmacro{\pft}{{\lstM}[Mod(\X+\Y-2,4)]}
  \ifnum\X=1
   \node[draw,minimum size=1cm,anchor=north] (m\X\Y) 
   at ([yshift=\pgflinewidth]m\X\the\numexpr\Y-1.south){\pft};
  \else 
   \node[draw,minimum size=1cm,anchor=west] (m\X\Y) 
   at ([xshift=-\pgflinewidth]m\the\numexpr\X-1\relax\Y.east){\pft};
  \fi}}
 \draw[red,dashed]  (-2,-2) grid (6,6); 
\end{tikzpicture}
\end{document}

enter image description here

The red grid is just to guide the eye.