It depends what kind of law.
I once heard a story about this issue. I believe it was with the Chofetz Chaim, although I’m not 100% sure. A shochet came to the Chofetz Chaim, and told him that he wanted to switch careers. He said the halachos of shechitah were too complex, and he was always nervous about messing up on a small detail. Instead, he said, he wanted to open a business.
The Chofetz Chaim responded, “And you think that the halachos of running a business aren’t complex? Choshen Mishpat is from the most complex halachos! How can you open a business without first knowing Choshen Mishpat? It’s better to stay a shochet – the halachos there are simple compared to running a business!”
If you’re going to undertake something, make sure you know what’s involved first! Yes, there are times in life where you may be pushed into a situation where you don’t know the laws, and you do your best. But you should try to know the laws that are likely to have an impact on your life.