Sin against God. I already showed you above that there is no 'thou shalt not be partial' in the 10 commandments, but it is sin. How do we know? By the word of God and the witness of the spirit
When it comes to knowing God it is about spending time with Him.
Knowing sin is about studying the word of God and understanding the character and standards or principles outlined in the word.
Some things are harder to define but through the word and by the guiding of the Holy Spirit we can know.
The law is a good place to start.
Exo 20:3 Thou shalt have no other gods before me.
When I look at myself and ask God to help me see, ,, am I making money or work or my phone a god..
See how the word is a spiritual principle that the Holy Spirit can convict me with.
2Ti 3:15-17
15 And that from a child thou hast known the holy scriptures, which are able to make thee wise unto salvation through faith which is in Christ Jesus. 16 All scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness: 17 That the man of God may be perfect, throughly furnished unto all good works.
All scripture
No one is saying the 10 commandments makes other scriptures void.