How to make stock limited pet eggs

I came across a different post about this, I got the idea of how but I don’t know how to execute it efficiently. If anyone could give me an more detailed explanation on how I would be able to creat stock limited eggs that would’ve been nice