The first British trade with China came about with the British coming to China and establishing a trading post in Canton in 1699. At that point, the British were quite welcome in China because they were primarily buyers. They wanted tea and silk from China and were willing to pay for it. So, the British first gained entry to Chinese trade simply by buying from the Chinese.
However, the British came to be dissatisfied with this situation. They were losing silver to the Chinese and not getting any back because they had nothing that the Chinese particularly cared to buy. They tried to get the Chinese to buy more, but were unsuccessful. At that point, they turned to trading opium. The Chinese government tried to prevent this trade, which led to the British forcing their way into the China trade through the Opium Wars.
So, the British gained entry first by buying from the Chinese and then by forcing them to open to the opium trade.