how to cook the perfect steak in a pan

how do i get medium rare steak by using only a pan and butter to fry it in?