I couldn’t find a textual answer to this problem, so here it is: Let’s say you want to make a thumbnail from an existing picture and add three-dimensional. That is: Something in the foreground (e.g. a face), then the text, then something in the background. The trick is to add a layer mask. Here are the steps for GIMP.
Seems simple enough once you know the steps…