That’s like asking how you got into your skin. The turtle is born with its shell on.
A turtle’s shell is part of its body, half on top attached at the sides to the half underneath. The shell has two layers: the outer layer is a shell of hardened skin tissue, and the inner layer, a group of bony plates, is actually part of the turtle’s skeleton.
There are openings between the top half and underneath half through which the turtle can push out or pull in its head, legs, and tail. The turtle can close these two halves completely as protection against its enemies.
The female turtle, both water and land varieties, lays her eggs on land. She digs a hole in the ground with her back feet, lays her eggs in the hole, and covers them with soil or rotten plants.
Then she walks away and never returns, leaving her eggs to be hatched by the warmth of the sun.
After about ten days, baby turtles break open their shells, dig their way to the surface, and crawl back to the sea or scatter on land to get food and to protect themselves from the animals and birds which eat them.
The first turtles on earth lived more than 185 million years ago.