If you have violated a state or federal statute, and you have been charged with a crime, the prosecution will let you know which statute you are accused of violating in your arraignment. At the arraignment or before, you will be given a copy of the criminal complaint or summons which will tell you what specific law you are being accused of violating.
If you believe you have violated a state or federal statute and you have not yet been charged with a crime, you should seek the advice of an attorney to determine which statute you may have violated.