How to extrude mesh?

Say we have the following simple mesh data:

// additional data // Vector3(x, y, z) - +x left, +y up, +z forward // triangle indices are in clocwise order  // list of vertices that form a place List<Vector3> vertices = new List<Vector3>() {   new Vector3(2f, 0f, 2f),   new Vector3(-2f, 0f, 2f),   new Vector3(2f, 0f, -2f),   new Vector3(-2f, 0f, -2f), };  List<int> indices = new List<int>() {   0, 3, 2, 3, 0, 1 }; 

How to extrude given plane in a certain direction? E.g 2f in y axis, it should form a bottomless cube.

I’m interested in how it works in general, not only this specific example.