I am happy to help a bit with this as it is a subject I know well. You can also read on HMRC pages: https://www.gov.uk/capital-gains-tax
Firstly, Capital Gain Tax. This is the same for investments in CFD and Invest accounts.
Let’s do an example. Suppose I sell 10 shares of Apple. To figure out my capital gain HMRC says that I should take the proceeds of sale in GBP (using exchange rate on day of sale) and subtract 10 x the per share purchase price (also in GBP using exchange rate at time of purchase) of shares of Apple I have purchased previously or will purchase in the next 30 days. The per share purchase price is calculated by finding the average price as computed within certain categories, in a particular priority order: (1) firstly, any shares of APPL bought the same day, (2) secondly, any shares bought in the 30 days after the sale, (3) finally, any shares bought on previous days. In the case of (3) I am to use the average cost per share, averaged over all the purchases I may have made prior to my sale of shares. This collection of previously purchased shares is called a Section 104 holding.
For typical long term investors only (3) will actually be relevant because all owned shares will be in a Section 104 holding. But beware of (1) in case you sell one day and buy back in a few days later.
If in the course of a tax year I make gains on some sales and losses on other sales, the losses can be netted off against the gains. There is a trap to be aware of. The UK has a £12,300 CG tax free allowance. Suppose I had gains of £14k and losses of £10k. This would net to £4k and I would owe no tax. But I have lost the benefit of the full £12,300 tax free allowance. It would be better to net off only £1700 of losses, leaving £12300 net gains and hence no tax, and then carry the rest of the losses forward to use against gains next year. But this is not allowed. You must put all your losses into the calculation of net gain. However, there is a way around this in that you are not required to declare your losses immediately in the year they took place. You can delay the declaration for 4 years.
I think that covers the main points. Please ask again if any questions remain in your mind.
Obviously, a platform like Trading 212 cannot easily help with capital gains tax calculation. You have your own decisions to make again when to realise gains and losses. I manage this by keeping a Google sheet with lines for each different investment I own: APPL, MSFT, JNJ, etc. I track the date, number of shares bought or sold, price in USD, exchange rate that day and cost or proceeds in GBP. average cost per share of all shares bought in previous days.
Here are the top few lines of an example, showing the information I keep in order to prepare for capital gains tax calculations. This is for ETF SUWS which is priced in USD.