You have to create a farm solution with HideCustomAction element or you can event create you own custom action with your own implementation. Here is a blog post, or another sample about hiding custom actions.
To use this method you have to know your location ID. They are documented in this MSDN article.
To hide a delete button in List you should use
Location = CommandUI.Ribbon
Control ID = Ribbon.ListForm.Display.Manage.DeleteItem
FOR OFFICE 365
<CommandUIDefinition Location='Ribbon.ListForm.Display.Manage.DeleteItem' />
Hope this helps