How can Newton's first law of motion be obtained from the second law of motion?
To obtain Newton's first law of motion from the second law of motion:
From Newton's second law,
$$F = ma$$
If $$F = 0$$
then $$ a = 0$$
This implies that when force is not applied on a body, the acceleration will be zero. If the body is at rest, it will continue to say at rest, when it is moving, it will continue to moves in the same direction will the same speed.
Hence, a body not acted upon by an external force does not change its state of rest or motion which is the statement of Newton's first law of motion.