Koinly does a pretty good job of automatically detecting and merging your trades and transfers. There are however edge cases where Koinly does not merge your transactions so in these cases you will need to merge the transactions manually.
Merging two transactions into one is quite simple. You just need to select both transactions by ticking the little checkbox on the left and then you can click on the Merge button at the bottom of your screen:
What kind of transactions can be merged?
If you have a withdrawal in one of your wallets and a deposit of the same currency in another wallet then these can usually be merged into a single transfer. There are a few possible reasons why Koinly doesn't always merge transfers but it might indicate some underlying issue with your data. See this article for more info
If you have a trade that is being displayed as 2 separate transactions (a withdrawal of the spent currency and a deposit of the received currency) then you can merge these into a single trade.
Multiple deposits / withdrawals
If you have multiple deposits taking place on the same day (for example staking rewards paid out every hour) then you can merge these into a single deposit.
The same applies to withdrawals - if you have multiple withdrawals (such as fees) on the same day then you can merge them into a single transaction.