Time is key here. Try to clean the spill as soon as possible. Stains in hardwood floors that penetrate the finish into the wood itself can be difficult to remove. The stain may require sanding and refinishing, but if it has gone too deep, even that may not remove the blemish entirely.
Non-greasy items like nail polish and food should come off with dish detergent mixed into warm water. Simply rub it onto the spot using a soft cloth. Treat greasy stains on surface-finished floors like you would watermarks.
When removing wood stains, always follow the general guidelines for cleaning wood floors: Always dry thoroughly and only use products recommended for your type of flooring and finish. If it’s a big stain or something stubborn, contact a professional, as they can advise on the best way to remove stains from wood floors without causing irreversible damage.