Frogs get oxygen by breathing through their lungs, the lining of their mouths and their skin. When a frog breathes with its lungs, the system operates much the same as it does with humans. The frog takes in oxygen and releases carbon dioxide.
However, because the frog lacks ribs and a diaphragm to help its lungs contract and expand, it needs to raise and lower the floor of its mouth. This action is called buccal pumping. Buccal pumping helps the lungs, which are small and poorly developed in a frog, contract and expand. Only one species of frog is known to have no lungs.
When it's on land and at rest, a frog gets most of its oxygen through the lining of its mouth. Oxygen easily passes through this lining, and carbon dioxide passes out.
When a frog is completely in a body of water, it uses its skin to breathe. As it is an amphibian, the frog's skin needs to be kept moist and is water permeable. The skin also has a great many blood vessels that allow oxygen and carbon dioxide to pass in and out. When a frog is out of the water, its skin takes in oxygen from the air.