In eBay jargon, bidders retract and sellers cancel. A seller can cancel any bid at any time before the auction ends. A bidder can retract their bid if the auction has more than 12 hour left. During the final 2 hour, a bid can be retracted only within an hour after being placed.
Go to My eBay > Selling and find the item. From the More actions drop-down menu, select End My Listing Early. If there are bids on your item, choose how you want to end your listing. If there are 12 or more hours before the end of the listing, select Cancel bids and end listing early or Sell item to high bidder.
If the listing ends in under 12 hours, you can retract your most recent bid, but only if it's been less than an hour since you placed it. If you are outside that time frame, your best bet is to communicate directly with the seller and persuade them to cancel your bid at their end.
Cancelling an eBay bid can be done via the 'retracting a bid' page, using the 'retract a bid' button. Simply click on this, then select the product you wish to retract your bid for and give your reason for doing so. You'll find lots of other helpful advice on this page, too.