Hi, timps.
You've already been given some good answers here, and my hope is to somehow add to the same.
Sometimes, when we're trying to understand the meaning of a particular word or teaching, it helps to see where it first appears in scripture, and then work our way forwards from there.
Unless I'm mistaken (and, believe me, somebody will bite my head off if I am...lol), then faith is first applied to Abel in scripture, so let's see if we can determine what it first meant in relation to him.
"By faith Abel offered unto God a more excellent sacrifice than Cain, by which he obtained witness that he was righteous, God testifying of his gifts: and by it he being dead yet speaketh. " (Hebrews 11:4)
It seems to me, others may disagree, that Abel's faith pertained to three different things:
1. The "more excellent sacrifice" that he "offered".
2. The "God" to whom he offered it.
3. His desire to be deemed "righteous" via his "sacrifice" in God's eyes.
Here's the actual account:
Genesis chapter 4
[
1] And Adam knew Eve his wife; and she conceived, and bare Cain, and said, I have gotten a man from the LORD.
[
2] And she again bare his brother Abel. And Abel was a keeper of sheep, but Cain was a tiller of the ground.
[
3] And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto the LORD.
[
4] And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the LORD had respect unto Abel and to his offering:
[
5] But unto Cain and to his offering he had not respect. And Cain was very wroth, and his countenance fell.
[
6] And the LORD said unto Cain, Why art thou wroth? and why is thy countenance fallen?
[
7] If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him.
[
8] And Cain talked with Abel his brother: and it came to pass, when they were in the field, that Cain rose up against Abel his brother, and slew him.
When we read the above, one of the first questions that we should ask ourselves is this:
How did both Cain and Abel know that they needed to make an offering or a sacrifice unto the LORD.
Well, for one thing, when Cain and Abel's parents, Adam and Eve, sinned, God, while pronouncing a curse upon the serpent, said the following:
Genesis chapter 3
[
14] And the LORD God said unto the serpent, Because thou hast done this, thou art cursed above all cattle, and above every beast of the field; upon thy belly shalt thou go, and dust shalt thou eat all the days of thy life:
[
15]
And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel.
I bold-faced verse 15 because this is what is commonly known as the "protevangelium", which translates into English as "the first gospel" or the first proclamation of the good news.
In other words, here, God, for the first time, prophesies or foretells of the Messiah or Christ, "her seed", which shall "bruise thy", the serpent's, "head" whereas the serpent "shalt bruise his heel".
Elsewhere in scripture, the Devil or Satan is referred to as being "that old serpent" (Revelation 12:9, 20:2), so we need to understand that this is who "the serpent" (Gen. 3:14) represents.
Whereas "seed" in normally attributed to men in scripture, this prophetic utterance spoke of "her seed", and Jesus was ultimately born of a virgin, and he is the one whom God foretold would ultimately "bruise" the serpent's or Satan's "head".
This, of course, was accomplished via Christ's crucifixion, burial, resurrection from the dead, ascension back to heaven, and glorification at the Father's right hand by which he delivers those who believe in him from Satan's power.
Anyhow, I said all of that to say this:
When Adam and Eve sinned, they sought to cover their nakedness with fig leaves (Gen. 3:7), but God had an entirely different covering in mind.
We read:
"Unto Adam also and to his wife did the LORD God make coats of skins, and clothed them." (Genesis 3:21)
Well, if God clothed them with "coats of skins", then he had to get those "skins" from somewhere, and most, if not all, Bible commentators agree that God killed an animal, a type of Christ who would ultimately be slain for the forgiveness of our sins, and clothed them with the "skins" of the same.
In other words, God not only foretold of a coming Messiah or Christ, but he also killed an animal as a type of the same.
In fact, if we go back even further than "Genesis" or "the beginning", then we learn the following:
I Peter chapter 1
[
18] Forasmuch as ye know that ye were not redeemed with corruptible things, as silver and gold, from your vain conversation received by tradition from your fathers;
[
19] But with the precious blood of Christ, as of a lamb without blemish and without spot:
[
20] Who verily was foreordained before the foundation of the world, but was manifest in these last times for you,
[
21] Who by him do believe in God, that raised him up from the dead, and gave him glory; that your faith and hope might be in God.
Before the foundation of the world, Jesus Christ was "foreordained...as of a lamb without blemish and without spot".
In other words, he was foreordained to be the sacrificial "Lamb of God which taketh away the sin of the world" (John 1:29), and the things that we're presently reading about in the book of Genesis in relation to Adam and Eve, and Cain and Abel, are directly related to this reality.
So, how did both Cain and Abel know that they needed to bring offerings or sacrifices unto the LORD?
Well, although the Bible doesn't specifically tell us, it seems rather apparent that either their parents told them because of what God said to them in relation to the coming Messiah or Christ and the animal that he killed as a type thereof to provide them with coats of skins, or that God told them directly, or that an angel revealed it to them.
Whatever the case actually was, they both apparently knew what type of offering or sacrifice was acceptable unto the LORD because of what we read earlier:
Genesis chapter 4
[
3] And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto the LORD.
[
4] And Abel, he also brought of the firstlings of his flock and of the fat thereof.
And the LORD had respect unto Abel and to his offering:
[
5]
But unto Cain and to his offering he had not respect. And Cain was very wroth, and his countenance fell.
[
6] And the LORD said unto Cain, Why art thou wroth? and why is thy countenance fallen?
[
7]
If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him.
The LORD had respect unto Abel and his offering: but unto Cain and to his offering he had not respect.
Furthermore, the LORD told Cain, "If thou doest well, shalt thou not be accepted?", and this leads us to believe that both Cain and Abel knew what type of offering or sacrifice was acceptable unto the LORD.
Which brings us full-circle back to what I suggested earlier in relation to Abel's faith.
It seems to me, others may disagree, that Abel's faith pertained to three different things:
1. The "more excellent sacrifice" that he "offered".
2. The "God" to whom he offered it.
3. His desire to be deemed "righteous" via his "sacrifice" in God's eyes.
In relation to point #1, Abel's "more excellent sacrifice" was "the firstlings of his flock" (Gen. 4:4).
If you understood what I said earlier in relation to Christ being foreordained before the foundation of the world as the Lamb of God which taketh away the sin of the world, the seed of the woman or the Messiah/Christ who would bruise the serpent's head, and the skins of a slain animal by which the LORD himself clothed Adam and Eve which foreshadowed Christ's own sacrifice on our behalves, then you should also be able to understand why Abel's sacrifice of the firstlings of his flock perfectly aligns itself with all of these things in that it too prefigures the Messiah or Christ who would ultimately be slain.
That said, I personally believe that part of Abel's faith pertained to his "more excellent sacrifice or, more specifically, to the Messiah or Christ to which it pointed.
As far as point #2 is concerned, I also believe that part of Abel's "faith" pertained to the God to whom he made the sacrifice or that it showed his belief in the reality that the only acceptable sacrifice in God's eyes is the Messiah or Christ who Abel's sacrifice prefigured.
As far as point #3 is concerned, I also most definitely believe that part of Abel's "faith" pertained to his desire to be deemed righteous in God's eyes, and, Biblically speaking, there is no way to be made righteous in God's eyes other than through the sacrifice of Christ on our behalves.
What, then, does any of this mean to you?
Well, if you want to similarly be made righteous in God's eyes, then you need to put your own saving faith in Jesus Christ in order to do so.
Sorry for such a long response, but I want to make sure that you understand what I am attempting to say to you.
I hope that this helps.