If you are on your way to a resaurant or have not picked up the order yet, you can cancel the trip in the app. You will not be penalized for canceling an order you have not yet picked up.
If you are already at the restaurant but have not picked up the order, tell the reasaurant yu are canceling in the app. Another will receieve the request and complete the order.
If you have already picked up the order and you are on your way to the drop off location and cannot complete the drop off process contact Uber Support.
How To Contact Uber Support:
Open your Driver app
Tap the menu icon
Tap Call Support, then Call