There are multiple ways you can actually go about closing your position, but in essence, what you'll need to do is place an order for the same amount in the opposite direction. So, if you have an open short position for -500 contracts, you need to place a buy order for +500 contracts to close it out.
How do I know whether I'm long or short?
If you take a look at Size under the Positions widget, you'll either see the amount in green or red with a negative sign. If the size is green and positive, you're long. If it's red and negative, you're short.
Where can I see how many contracts I have open right now?
You can refer to the Size in Positions widget to see how many contracts you have open.
Closing position through Positions widget
The simplest way to close your position is using the Close Position column in the Positions widget. With this method, you don't have to worry about making sure you're placing the order on the right contract, in the right direction, or for the right amount as the system does all that for you.
All you would need to do is either set your Limit Price (by adjusting the prefilled value beside the buttons) and hit the Limit button or just use the Market button if you want to get out of the position at the current Market price.
Closing position through Place Order widget
Another way you can close your position is through the Place Order widget on the left-hand side of the Trade page. With this route, you have far more details you can set for your order. For a breakdown of this widget, take a look at Place order widget article.
With this, just make sure you have the right contract selected, Size equals to your position size, and you click Buy if you're short or Sell if you're long.
Beyond that, we recommend checking Reduce-Only or Close on Trigger as those instructions will make sure that your order won't require Order Margin or increase your position size.