A warranty (a term which is used interchangeably with 'guarantee') essentially guarantees that a car will be free of defects for a certain amount of time. If the car develops a fault during that period, the provider of the warranty will need to fix the problem (as long as the malfunction was not caused by the consumer - eg because they crashed the car).
New cars generally come with a manufacturer's warranty, which typically lasts for 3 years or 60,000 miles, subject to the car being serviced on time. This warranty can sometimes be extended at cost - but extended warranties sometimes contain different terms than the initial warranty.
Second-hand cars which are relatively new will sometimes still be covered by the remainder of the manufacturer's original warranty. Separately, if a second-hand car is purchased from a main dealership, these may come with an 'approved used car warranty'. This is often marketed as a manufacturer's warranty but may have different terms - normally for a period of 12 months.
Smaller second-hand car traders may offer their own types of warranty in conjunction with certain insurance companies, but the terms can differ widely and may come with various restrictions and caps on any repair payouts.