Cut the shallots into thin, even slices — try to keep them the same thickness so they cook at the same rate. Prepare a heatproof bowl and a sieve on the side.
Pour the oil into a small pot and add the shallots. Start on medium heat. Stir regularly to stop the shallots from clumping — you do not need to stir constantly, just often enough for them to cook evenly.
Once the shallots have shrunk and the edges start to turn slightly golden brown, reduce to the lowest heat. As soon as they are lightly golden all over, immediately pour the oil through the sieve into the heatproof bowl to stop the cooking.
Tip: Do not wait for the shallots to turn fully golden in the pot. The residual heat will continue to cook them after you remove them. If the shallots turn dark or smell bitter, they are burnt and the oil will taste bitter. It is always better to undercook than overcook.