Amazon will try to cancel orders that are preparing for shipment, but may not always be able to.
To cancel an order;
Log in to your Amazon account.
Hover over the "Your Account" menu. Scroll down and click on the "Your Orders" option.
On your order summary page, find the order you want to cancel. You'll see an option to the right of the item that says "Cancel items."
Scroll down and select your cancellation reason from the dropdown menu before clicking the "Cancel selected items" button at the bottom right.
You'll be sent to a confirmation screen and an email will be sent to you detailing your cancellation request.
You'll receive a further email when it's determined whether or not your order could be canceled.