If you have traded on an exchange that is no longer in existence then there is usually no way of finding your transaction history for it (unless you downloaded it before it was shut down).
However, there are some things you can do to minimize your gains:
Tag withdrawals to the exchange as Lost
If you are seeing large gains on withdrawal transactions that were actually transfers to this closed exchange, you can mark these as Lost. The lost tag will prevent gains from being realized on the withdrawals.
Create a custom wallet from memory
if you have some idea about the kind of trades you made on the exchange then it may be worth creating a wallet for it and then manually turning any deposits in your other wallets to "Transfers" and doing the same for any withdrawals that originated from this exchange.
Once this is done you will be left with some "Missing purchase history" errors. These can be resolved by creating some trade transactions manually.
🔵Example. If you sent 1 BTC into Cryptopia then traded it for 10 ETH and then transferred the 10 ETH to another exchange, here's how you would handle this:
First, find the transaction in the wallet that you "sent" 1 BTC from and change it to a Transfer to Cryptopia,
Then you would find the deposit transaction in your other wallet for the 10 ETH that was received from Cryptopia and change it to a Transfer too.
Finally, you would create a manual trade transaction in your Cryptopia wallet for 1 BTC -> 10 ETH. The date for this transaction would be a best guess.
What do the tax agencies say?
Normally a tax agency will ask you to make your best effort when filing taxes. It is highly unlikely that your tax agency would be able to retrieve records for a defunct exchange (unless the exchange was based in the same country). If you do not have records for an exchange and there is no way to retrieve these records then you should consider declaring this on your tax return to avoid any kinds of fines.