How to short a stock? There is the complicated answer and the simple answer. I'll give you the simple answer because in practice one never sees the complexities going on in the background.
First, one must have a 'margin account' with a broker. They may also require some other things, but generally, just opening a margin account allows one to short stocks.
Second, place an order for the stock you wish to short. Generally this is done exactly like placing a long order but maybe checking a box that says 'short' or 'sell' or perhaps placing a negative sign for the shares to trade. That's it. It's completely transparent what is happening in the background. It's as easy as that.
When you want to close a short position simply 'buy' shares exactly as one would if opening a long position. You don't need to explicitly say you are closing a short position. The broker will take care of all the details in the background.
Now, for all their effort in the background, your broker will charge interest and/or fees. Since you are basically borrowing shares they will charge you 'interest' on that amount borrowed. It simply shows up on your account statement each month.
As a trader shorting stock is very simple. For the 'complicated' answer of what's going on in the background maybe do a google search. There are a lot of sites that go into the details. Just remember, those details are taken care of by your broker. Generally one doesn't need to do anything more than buy and sell similar to going long. Just watch your monthly statement to make sure you understand the associated charges.
Hope that helps.