I'm not sure what tutorial you're following, but I think I see what happened. It looks like you selected the opposing faces, then extruded them along the Y axis by pressing E and then Y like so:
Which has the unintended effect of squishing the far face inside the cube, since both are moving in the same direction. Which causes the overlapping mesh you're struggling with.
What you're probably wanting to do is extrude the two faces away from each other. For this you'd press E to extrude, then S to resize them, and Y to still restrict it to the Y axis:
Or alternatively you could extrude just one of the faces with E and then Y, repeating as needed: