OpenGL quad layering

So. if i’m rendering textured quads, and want to have them layered, what would be the best way to do this? currently I just render them in the order they’re to be layered, but this seems like a bad way to do it.
basically right now it’s just

GL11.glBegin(GL_QUADS);
//4 corner coords go here
GL11.glEnd();

4 times in the order I want to layer them. Should I be using 3D coords and using the Z coordinate, or does this not work?
like:

GL11.glVertext3f(0, 0, 1);
GL11.glVertex3f(1,0,1);
GL11.glVertext3f(0, 1, 1);
GL11.glVertex3f(1,1,1);

then change to:

GL11.glVertext3f(0, 0, 2);
GL11.glVertex3f(1,0,2);
GL11.glVertext3f(0, 1, 2);
GL11.glVertex3f(1,1,2);

for a closer/further layer?