In general, whether a person is negligent or not is a question of fact based on what the jury thinks would be reasonable under the circumstances. However, there are certain things that automatically make you guilty of negligence (aka negligence per se). For example, in the case of Martin v. Herzog (228 N.Y. 164, 126 N.E. 814 (1920)), Herzog was driving at night and ran into Martin, who was killed. Martin was driving without lights on. The Appellate Court found that Martin's failure to follow traffic laws was more than just evidence of negligence, it is negligence itself. The Court found that violating a State Statute (it was against the law to drive without lights), pretty much makes you automatically guilty of contributory negligence.
Restatement of Torts says that, "violation of
Statutes is, subject to some qualifications, 'negligence per se'."