There are two verses about obedience in Romans 6:17-18-NKJV that are significant:
“But God be thanked that though you were slaves of sin, yet you obeyed from the heart that form of doctrine to which you were delivered. And having been set free from sin, you became slaves of righteousness.”
We must obey “from the heart” that form [pattern] of doctrine that Paul preached and taught (1 Cor. 2:1-2; cf. Gal. 6:14; Philippians 3:7-10). What was the pattern? The death, burial and resurrection of Jesus (1 Cor. 15:1-4). We die to sin, we are buried in the watery grave of baptism, and then we rise to walk in newness of life (Romans 6:1-4).
What a beautiful picture of salvation!