The answer from @user6726 is a good one. But, I'd like to add to it by pointing out that the body of law applicable to an individual is usually much, much smaller than the entire body of law. I'm a lawyer who has been in private practice for almost 25 years with an extreme diverse practice compared to the average lawyer, and I've never even looked at perhaps 80% of the laws on the books in the states where I practice, and even less elsewhere.
By statutory and regulatory volume, the vast majority of statutory and regulatory law is applicable to either the internal operations of government, or to the way in which regulated industries and business transactions are conducted. And, it is customary for people in situations in all of those situations to have professional intermediaries such as lawyers, realtors, brokers, architects, general contractors, accountants, tax preparers, and consultants to assist them in complying.
Some of the more technical areas encountered by average people (e.g. traffic laws) are areas in which training is mandated before you can get a driver's license.
Many other areas of occupational and industry regulations are similarly distinguished by having a licensing requirement to make sure that everyone involved knows that a new body of law applies to them. You only need to know about nuclear power plant regulations, for example, if you build a nuclear power plant and will soon learn if you try to do so that you need a license to do that.
Even within areas of law that have broad applicability like tax law and criminal law, a lot of the law has only narrow application. For example, most people don't need to know the rules for determining the taxable income of a life insurance company, or the criminal laws pertaining to people who have security clearances to review top secret national security information.
The body of "private law" governing the rights of individuals vis-a-vis other private individuals, and of criminal law that an ordinary person is in a position to violate, is very modest. And much of the law in this area is devoted to determining how serious an offense is and what the penalty should be, and what law enforcement is allowed to do in order to investigate these violations, and not to what is legal and illegal in some regard.
For example, intentionally, recklessly or negligently offensively touching or causing injury to someone else's property or person, is almost always either a crime and/or a civil wrong called a tort for which you can be sued. Some versions of this conduct are more serious (e.g. rape or murder), some are less serious (e.g. pinching someone on Saint Patrick's Day for not wearing green). But the overriding concept, once you strip away the details, is pretty simple.
Likewise, damaging or taking property that isn't yours, intentionally, recklessly or negligently, is almost always either a crime and/or a civil wrong called a tort for which you can be sued.
Add the notion that you have to honor your promises in most circumstances and shouldn't lie or deceive in most circumstances, you have to follow authoritative signs and directions from legal authorities, and you have to figure out if you owe income taxes or not each year with professional help, if necessary, and you are well on your way to knowing what you need to know to obey the law.
Even within "private law" there are lots of areas like patent law, product liability law, and oil and gas property rights, that the average person doesn't need to know. Knowing that if you are injured by someone else you should think about talking to a lawyer is usually good enough.
These bare bones may prevent you from doing things that are legal but close to the boundaries of what is allowed sometimes, but having standards higher than the bare legal minimum is rarely a deep impediment to living a decent life. It should also be enough to let you have some intuition that you are in a gray area and need to confer if you aren't sure if something is illegal or not.
There are more complicated areas that many average individuals do have to deal with to some extent. The law governing privacy, copyright and speech comes to mind, for example. But, you can go a very long way on some very basic principles. Most law that applies to ordinary people flows from simple moral intuition.