Swearing to one's own hurt, as in Psalm 15:4, means binding oneself by an oath or promise and not changing it, even if fulfilling it causes pain, loss, or inconvenience. This applies to any pledge, formal or informal, reflecting personal honor and integrity. God keeps His word unalteringly, as in Isaiah 55:11 and Numbers 23:19, so people must do the same to be trustworthy. It separates the upright from pretenders and is a qualification for dwelling in God's holy hill. Jesus advises letting yes be yes (Matthew 5:37). Examples include the Rechabites' faithfulness, Jephthah's vow, Daniel's commitment, and marriage/baptism vows. Also see sermons and articles about Swearing to One's Own Hurt.
Psalm 15:3-4 He who does not backbite with his tongue, Nor does evil to his neighbor, Nor does he take up a reproach against his friend; In whose eyes a vile person is despised, But he honors those who fear the LORD; He who swears to his own hurt and does not change;
Psalm 15:1 LORD, who may abide in Your tabernacle? Who may dwell in Your holy hill?