Ps 38 is a penitential psalm where David begs God for forgiveness. For example:
- V3 - there is no rest in my bones because of my sin.
- V5 - My wounds are foul and festering because of my sinful folly.
- V18 - Yes, I confess my iniquity; I am troubled by my sin.
In this psalm, David's sense of guilt overwhelms him to such an extent that he feels physical pain and discomfort and asks God for assurance and help.
In describing his physical discomfort, David uses a VERY common Hebrew metaphor of the "Bones" being either out of joint or broken or out of place. Many Hebrew writers employ this same metaphor when distressed such as, Ps 6:2, 22:14, 17, 31:10, 32:3, 35:10, 42:10, 102:3, 5, Jer 20:9, 23:9, Lam 1:13, 3:4, Hab 3:16, etc.
Thus, in Ps 38, David uses a common Herew idiom of "no rest/peace/shalom in my bones" for expressing his feelings of guilt.