Can someone be saved if they willingly live in sin? For example, if somebody says, &quot;Since God forgives sins, why not live a sinful life? Then when I'm dying in my bed, I'll just ask him to forgive me for my sins.&quot;
How should I respond to that person? Does God really save such people?
Some people might think this question is too general, but I am just asking what the Bible says, which would make it universal.
If a person should be aware that God forgives sins and should yet purpose to live a sinful life, then (whatever they theorise about an unknowable future) they are already in danger of perdition, of destruction and of eternal hell-fire, for the following reasons :
1. Because it is hard-hearted

To day if ye will hear his voice, harden not your hearts, [Hebrews 3:15 KJV]

Scripture warns us not to harden our hearts against God's goodness. &quot;... Despisest thou the riches of his goodness and forbearance and longsuffering; not knowing that the goodness of God leadeth thee to repentance?&quot; [Romans 2:4 KJV.]
The goodness of God in granting us a fresh day to live, another day of hope, another beat of the heart with which to function, another sun-rise giving another opportunity to pursue eternal life ... should all urge us to repentance and faith.
Not to harden our hearts, yet more and more.
2. Because it is un-believing

But we are not of them who draw back unto perdition; but of them that believe to the saving of the soul. [Hebrews 10:39 KJV]

Not to proceed in one's life with faith is to not proceed at all in the direction of heaven. It is to 'draw back' as the writer to the Hebrews words it.
And such unbelief will cause even more hardening of the heart.
3. Because it is sinful.
If a person should deliberately put off repentance in favour of any other thing at all, then that course of action is, in itself, sinful.

... who were dead in trespasses and sins: ... [Ephesians 2:1 KJV]

To continue in committing deliberate misdeeds, and wilful sinful actions is to be dead to all that is good and to be alive to all that is wicked.
4. Because it is un-caring

if thou warn the wicked of his way to turn from it; if he do not turn from his way, he shall die in his iniquity; but thou hast delivered thy soul. [Ezekiel 33:9 KJV]

If a person should deliberately continue to live a sinful life they are being a bad example to others. Far from helping others to repent and believe the gospel, they are purposefully setting forth an example of a wicked life and that adds to their culpability.
The thought of what one's actions do to other people is sufficient to prevent one publicly living a wicked life.
5. Because it attempts to mock God

Be not deceived; God is not mocked: for whatsoever a man soweth, that shall he also reap. [Galatians 6:7 KJV]

What we do, every day - and every hour of every day - sows seed in our own lifetime. And we shall reap what we have sown. If one should deliberately sow evil seed, knowingly, then one deceives oneself to think that one will not reap exactly what one has sown.
For God is not mocked.
6. Because it is contrary to Wisdom

Wisdom crieth without; she uttereth her voice in the streets: She crieth in the chief place of concourse, in the openings of the gates: in the city she uttereth her words


How long, ye simple ones, will ye love simplicity? and the scorners delight in their scorning, and fools hate knowledge?


Turn you at my reproof: behold, I will pour out my spirit unto you, I will make known my words unto you.


Because I have called, and ye refused; I have stretched out my hand, and no man regarded;But ye have set at nought all my counsel, and would none of my reproof: I also will laugh at your calamity; I will mock when your fear cometh;


When your fear cometh as desolation, and your destruction cometh as a whirlwind; when distress and anguish cometh upon you.

God is not mocked. And neither shall Wisdom be so mocked.
To purposefully life a wicked life, supposing that there will be opportunity in the future  to amend one's ways is contrary to all wisdom.
It is downright foolish.
7. Because it is foolish

Because there is wrath, beware lest he take thee away with his stroke: then a great ransom cannot deliver thee. [Job 36:18 KJV]


But God said unto him, Thou fool, this night thy soul shall be required of thee: [Luke 12:20 KJV]

8. Because such a thought should not exist.

What, then, shall we say? shall we continue in the sin that the grace may abound? Let it not be.  [Romans 6:1 Young's Literal Tranlation.]

If God should be gracious to his sinful creatures and show kindness in the sending of his own Son that he might be the Saviour of the world, then the very idea of continuing to sin against him should not be in the mind of any one of them.
The thought should not even exist.
Let it not be.
9. Because others have proved it is a fatal way.
Esau presumed that, after he had lightly regarded what was of God (his heritage and his advantages) he could, on a future occasion, reverse his decision. But he was very much mistaken :

...for ye know how that afterward, when he would have inherited the blessing, he was rejected: for he found no place of repentance, though he sought it carefully with tears. [Hebrews 12:17 KJV]

Esau could find no place of repentance. Despite his efforts and despite his weeping tears.
The place was gone.
Another had taken his place.
And Esau was rejected.