Locate the trade you want to close in Positions panel (bottom right of dashboard by default).
Click on the Close button.
You will be prompted to enter a value for the portion that is to be closed. Trades can be closed fully or partially. In this example, full position size is 1 BTC. You can choose a number smaller than 1 to close partially, or 1 to close all of the trade. Realized P&L and any unrealized P&L will be adjusted accordingly.
When you close a trade, what actually happens behind the scene is that system places another order in the opposite side of the first order you placed. This order is also called settlement order, or the trade closing order. Therefore, in the Orders panel, you will see another order being logged. Note that slippage can always happen.
In the Transactions panel, you can see that some more transactions belonging to the margin type have been added.