A warranty is a form of guarantee or assurance that the product you bought operates as intended. Almost all products carry either a written warranty or an implied warranty.
A written warranty (also called expressed warranty) is like a contract. In it are the terms and conditions of what you can expect from the product. Most types of written warranties promise that the product is free from defects for a prescribed period of time.
Most of the time, if the product is broken or defective the seller will either replace the product or refund your money. If the seller refuses to honor its own warranty the seller can bring a legal action. The best forum in which to litigate such a case would be small claims court.