Yellow nails are commonly caused by the pigments used in nail polish.
Baking soda can remove these stains. Make a paste of equal parts baking soda and hydrogen peroxide. With a cotton swab or nail brush, scrub the paste onto the top and underside of your nails. Leave the solution on for 3-4 minutes, then rinse.
Yellow nails could be a sign of a fungal infection, so if the stains still appear after you have applied the paste, you should consult a doctor.