Follow the steps below.
1. Make a nether land portal.
2. Get any piece of material that you want to be unlimited.
3. Throw it into the nether portal.
4. Go in to retrive your item.
5. Go back to the real world.
You should now if you performed the glitch correctly have an endless supply of that material.