How to execute server-side code when clicking a button?

I am not familiar to rails. Can you show me the command to delete posts for that user