The first Opium War took place from 1839-1842. British traders were importing opium from India into China, against the wishes of the Chinese government. The Chinese destroyed a warehouse full of opium, and the British responded by sending a fleet of warships. The Treaty of Nanjing brought an end to the conflict. The treaty also ceded Hong Kong to Britain.
The second Opium War took place from 1856-1860, and began when Chinese officials boarded a British ship and searched it. The French joined the British in sending an invasion force to China, and the city of Beijing was occupied before the conflict ended with a treaty.
One of the British objectives in the Opium Wars was to increase trade with China, and that was essentially accomplished.