Why did some leaves of my fresh Fenugreek turn yellow after a few days of purchase, and how to prevent the leaves from turing yellow?
It's a sign that chlorophyll, the substance that enables photosynthesis and gives the plant is green colour is fading from the plant due primarily to lack of water and nutrients. When chlorophyll fades you're left with the underlying colour of the leaves.

It's simply a sign that water is evaporating from the leaves.

If you don't like the yellow colour, just remove those leaves, it doesn't have any effect on the overall flavour or usefulness of the herb.

The only way to prevent it, is to keep the stems in a glass of water, which helps to preserve the chlorophyll, but it won't do so forever, eventually the leaves will still turn yellow. However, if you're trying to dry the leaves that's rather counter-productive!