The passage in Heb 3:7-11 quotes the Septuagint Passage of Ps 95:7-11. Here it is as translated from the standard Hebrew text:
For He is our God, and we are the people of His pasture, the sheep
under His care. Today, if you hear His voice, do not harden your
hearts as you did at Meribah, in the day at Massah in the wilderness,
where your fathers tested and tried Me, though they had seen My work.
For forty years I was angry with that generation, and I said, “They
are a people whose hearts go astray, and they have not known My ways.”
So I swore on oath in My anger, “They shall never enter My rest.”
However, Hebrews appears to more closely follow the Greek translation of this called the "Septuagint" (about 250 BC), which translates as follows (numbered as Ps 94 in the Greek)
For he is our God; and we are the people of his pasture, and the sheep
of his hand. To-day, if ye will hear his voice, harden not your
hearts, as in the provocation, according to the day of irritation in
the wilderness: where your fathers tempted me, proved me, and saw my
works. Forty years was I grieved with this generation, and said, They
do always err in their heart, and they have not known my ways. So I
sware in my wrath, They shall not enter into my rest.
The Bible writers understood that the ancient Hebrew prophets did not write the Bible by their own initiative but were inspired by the Holy Spirit. See 2 Peter 1:20, 21 -
Above all, you must understand that no prophecy of Scripture comes
from one’s own interpretation. For no such prophecy was ever brought
forth by the will of man, but men spoke from God as they were carried
along by the Holy Spirit.
We find the same declaration by Paul in 2 Tim 3:16 -
All Scripture is God-breathed and is useful for instruction, for
conviction, for correction, and for training in righteousness
[Note that the word in both Greek and Hebrew for "breath" is the same as "spirit".] Thus, the writer of Hebrews in Heb 3:7 is attributing the text of Psalms to the inspiration of the Holy Spirit.