Potatoes turn green when they’ve been exposed to too much light. When this happens, they can develop two toxins called solanine and chaconine, which are dangerous at high levels.
Luckily, you can still use green potatoes by simply peeling off the green skin, any new shoots, and any flesh that may have a green color. You can then prepare it however you want.
To stop your potatoes from turning green, store them in a dark, cool place like a root cellar or basement. They should keep for several weeks but always err on the side of caution.