The bible says, we must not only be a hearer of the word, but a doer of the word also (James 1:21-22). DON'T FOOL YOURSELF! If we really have faith in Jesus our actions will prove it. If Jesus is our Lord then we will obey him. Even a child will obey a parent, by getting good grades in school, for the reward of a new bicycle. The child cannot earn money for the bicycle, but instead must act upon their faith to receive the free gift. We must do the same to receive eternal life. "FAITH WITHOUT WORKS IS DEAD” (James 2:20).
This comes very near the blasphemous and false doctrine of works-salvation. What is inevitable is not necessary. Though it is inevitable that an apple tree will bear apples (not oranges, or tomatoes, or tulips), it is not necessary to being an apple tree that it bear apples. In other words, bearing apples doesn't make an apple tree an apple tree. No, an apple tree must first be an apple tree before it can bear apples. Being always comes before doing.
So, then, we don't look at an apple tree that, because of immaturity, or lack of moisture, or poor soil, or disease (or all of these), is not producing apples and say, "This apple tree is not bearing apples so it is no longer an apple tree." That would be silly. All the tree needs is water, nourishing soil, freedom from disease, sunlight and time in order to produce apples. Because it is an apple tree, when these things are provided, apples develop naturally and in abundance.
In the same way, it is silly to look at a born-again person not yet bearing spiritual fruit and declare, "This person is not bearing spiritual fruit and is therefore not a Christian." They might be brand new to the faith, and/or suffering from sinful addictions and false teaching, and/or are poorly-nourished spiritually and so are unable to produce spiritual fruit. Get the "fruitless" believer into a healthy spiritual circumstance and then see what happens. When they are well-fed spiritually, relieved of the spiritually-sickening effects of false doctrines and besetting sin, and walk daily in unhindered fellowship with God, spiritual fruit just naturally develops, no demands for it at all necessary, no threats of lost salvation required.
If all these things are available to the person who claims to be saved, but they are not bearing spiritual fruit, then it is proper to question the reality of their claim to membership in God's family. Again, though, being comes before doing: being a born-again person must precede bearing spiritual fruit; the latter can only come out of the former, not the reverse, as the false works-salvation doctrine asserts. But if all the elements required for spiritual fruit-bearing are available to a person and they don't produce corresponding "fruit," there is cause in this to doubt their claim to being truly born-again.