What is the process of extracting small blocks from a large block?

As I was exploring the course material for computer vision and image processing online, I saw a concept that was “fetching a small block from a large block”. I get the concept of it, and I can also visualize it, but I don’t get how to apply this concept using code and also using it efficiently. Can anyone explain it using a clean code snippet?