I think this is a pretty strange question because we usually want to diagonalize a matrix, not de-diagonalize it. However, this idea looks helpful in my work, so I like to ask. Let the field extension $K \subset L$ be a Galois extension, and $D$ be a diagonal matrix over $L$. My question is about (1) characterizing when $D$ can be written as a matrix over $K$ (up to a similarity transformation $T$ over $L$) and (2) how to do that explicitly, i.e. to find such a similarity transformation $T$. Necessarily, if it is possible, then the characteristic equation of $D$ has $K$-coefficients, but it splits over $L$, and the minimal polynomial of $D$ splits into distinct linear factors over $L$.
For example, consider the case of $\mathbb{C} = L$ and $K = \mathbb{R}$. We consider the matrix $$D = \begin{bmatrix} i & 0 & 0 & 0 \\ 0 & i & 0 & 0 \\ 0 & 0 & -i & 0 \\ 0 & 0 & 0 & -i \end{bmatrix}. $$ Then, the characteristic polynomial is $(x-i)^2(x+i)^2 = (x^2 +1)^2$ and the minimal polynomial is $(x-i)(x+i) = x^2 + 1$. However, actually, we know that $$ P^{-1}A P =P^{-1}\begin{bmatrix} 0 & 1 & 0 & 0 \\ -1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & -1 & 0 \end{bmatrix} P = D, $$ where $$P= \begin{bmatrix} 0 & i & 0 & -i \\ 0 & 1 & 0 & 1 \\ i & 0 & -i & 0 \\ 1 & 0 & 1 & 0 \\ \end{bmatrix}. $$
However, this example can be obtained because we already know that the matrix $A$ can be diagonalized to $D$. I believe that this is an example or an exercise from many linear algebra textbooks.
I think that finding a rational form (over $K$) from the data of $D$ can be useful. In the previous example, the minimal polynomial over $\mathbb{R}$ is $x^2 +1$, so by using the invariant factors $x^2+1$, $x^2+1$, we can find the form of $A$. Each block in $A$ is exactly the companion matrix of $x^2 +1$. Moreover, I think the coincidence of the minimal polynomials over $\mathbb{R}$ and over $\mathbb{C}$ was also important in this example.
In fact, I need to apply this kind of idea to a function field and a radical extension of it, but I guess a general discussion might be useful for clarifying the situation.