That was the dilemma that Cain and Abel faced in chapter 4 of the book of Genesis. Cain did give the basket of Fruit and Abel gave the lamb without blemish.
God accepted Abel’s offering which was made up of the firstborn of his flock and their fat; but rejected Cain’s offering of fruit.
How can we know the will of God? How do we take decisions that will please him?
It is instructive to know that about 2000 years later in Lev chapter 1-3, God gave detailed instructions on the type of offering acceptable to him. You guessed right - The flock and the fat: V.16 specifically says – all the fat belongs to the Lord.
How did Abel know, even before the law was given?
I think it had to do with his heart. His heart was right and he wanted to please God regardless of his desires or what anyone thought.
Cain’s first and only consideration was himself.
The follow up events prove this. When Cain’s sacrifice was rejected, he was angry and at the first opportunity he killed Abel and became the first murderer on the earth. So obviously, there was a problem with his heart and his desires.
Beyond the actual sacrifice God looks at the heart. What you have left after you have given is more important than how much you give. God loves a cheerful giver rather than a grumbling giver.
Are you agonising over a decision, you just don't know what to do. When our heart is right we become open to hearing and receiving His instructions on what to do and what decision to take. Especially if our whole desire is to do His will not ours.