
The most effective precautionary measure is to move far away from any active or dormant volcano, barring that, other precautionary measures for before a volcanic eruption is to constantly monitor the volcano for activity and to have an evacuation plan in place in case the volcano does erupt.
During an eruption it all depends on what type of eruption it is. If it is a cinder cone, just staying away is good enough. If it is a lava floe, you can just walk away, most lava moves pretty slowly, do not ever walk on the lava, it may look solid but often has molten lava running beneath it. Stay away from where lava meets water, there can be explosions...