Biblical vision
Terminal pain relief as such does not indeed occur in the Bible.
A well-known Psalm says: ‘He healeth the broken in heart, and bindeth up their wounds’ (Ps. 147:2). Clearly this is not meant in a literal sense, but it does illustrate that the Lord aims to heal. Also when the Lord Jesus walked on earth, He showed that human suffering was always of great concern to Him.
God is the God of Life. So for all healings that the Lord Jesus has done, He has never sought death as a solution for human suffering. On the contrary, terminally ill people and even people who had already died, were raised up by the Lord Jesus. Consider the history of the terminally ill servant of the centurion at Capernaum, who was healed, and which is immediately followed by the raising of the young man of Nain from the dead (Luke 7:1-18). We also read of the healing of Peter's mother-in-law (Matth. 8:14-18) and of the son of the nobleman (John 4:43-54), and of the raising up of the daughter of Jairus (Luke 8:40-56) and of Lazarus (John 11).
God did not create man for death, but for life. With the resurrection of Jesus Christ, God showed that He is the Living One, Who gives life. For his reason, Bible-believing Christians reject the administration of medicines that are primarily focused on shortening or ending a patient's life.
On the other hand, we must take into account that the full reality of the Kingdom of God is not yet visible. In other words: people must still die. In the process preceding dying, we need not at all costs avoid medicines that shorten life. Serious pain can and may be fought against. It is a question of seeking the right balance here, always in the realisation that God wants life.