Pack what the villager actually wants
Use Game version and Profession to find the offer you saw in the trading screen. Look at the item next to Your trade price before loading your inventory. A farmer buying wheat asks for less wheat after a discount. The emerald on the other side of that offer stays the reward.
For a trade with two costs, read the “Also pay” line before you leave. If a librarian wants emeralds and a book for an enchanted book, the discount changes the emerald cost. Bring the book for each trade too. Enter the first cost without discounts in First price before discounts when the same enchantment has a different starting price from the one shown here.
Check if curing again will help
Choose the version of the world you play in before filling in Times cured. In Java 1.20.2 and later, one cure is enough to get the price benefit from curing that villager. If you play in Java 1.20 or 1.20.1, choose the earlier option under Curing version to see how repeated cures affect the price. This calculator covers Java Edition.
Budget for a trade that keeps selling out
If you buy out the same offer every time the villager restocks, set Sellouts followed by restocks to the number of times that has happened. With no use between restocks, demand can come back down. Compare Demand increase with Reputation change to see which is moving the price. If you earned Hero of the Village, choose its level to see the price while the effect is active. Prices can differ between players at the same stall, so use the events and effect level for the player making the trade.