There are a couple of ways to prevent staining. The most important thing is to protect the nail plate. Before applying your polish, always apply a base coat. This creates a protective barrier between the nail plate and the color coat.
You can also try soaking a cotton ball in polish remover and gently press it on the nail. Wait about 5-10 seconds and then wipe the residue away towards the tip of the nail.
Keep your nail type in mind. Some nails are more prone to natural staining. For example, if you tend to have dry nail plates, you may experience more staining.