The law isn't meant to be ignored and following it isn't wrong (although following the parts like stoning people to death certainlly is). Romans 7:7 states " What then shall we say? That the law is sin? By no means! Yet if it had not been for the law, I would not have known sin. For I would not have known what it is to covet if the law had not said, “You shall not covet.”
The law points out sin to us so that we know it, but sin goes deeper than just following the letter of the law. For instance, because of the Ten Commandments, the Jewish people of Jesus's day knew it was wrong to sleep with someone outside of marriage Jesus pointed out that anyone who lusted after another man's wife had already committed adultery in his mind. Even if a person stops him or herself from sinning in deed, there's a mental component to the sin that a person can also commit. And it's impossible for humans to keep from sinning in both deed and mind. James 2: 10 "For whoever keeps the whole law but fails in one point has become guilty of all of it."
When Christ came He abolished the law in the sense that He freed us from being judged according to the law. If one tried to be saved by adhering to the law it would be impossible because humans just can't remain completely sinless. That doesn't mean the law is wrong. It just means that, under Christ, we're no longer judged by whether or not we uphold it perfectly.
Now, why do we obey some laws and not others? That's a more involved question. There are moral and cultural laws. The moral ones apply across most, if not all, situations. Do not steal. Do not lie. Do not murder. The cultural laws are laws that were given to the Israelites in the Old Testament to set them apart from other cultures or keep them safe in certain circumstances. For instance, God forbade the Israelites from eating certain animals, yet in the New Testament told Peter it was okay to eat animals that were previously considered unclean. We're not entirely sure whether this command was because of a health risk, because neighboring peoples ate certain types of animals and God didn't want the Israelites drawn into other religions, or just to make the Israelite culture different. Maybe all three. But the law applied only to the Israelites, not to us as Christians. Other laws, Jesus fulfilled entirely. We no longer offer sacrifices for our sins because Jesus's sacrifice was all we needed.
Now, sometimes it gets confusing which laws are cultural and which are moral. As a guide, it's helpful to see which ones are repeated in the New Testament and which are overthrown, but there are some that are up for debate. However, that's how I've had it explained to me.