There are literally hundreds of Threads and Articles on DIY CO2 on this Forum, and many others. Use the search key.
As for the proper sealing, mentioned above, the best bet is to drill a hole in your bottle cap the same diam. as the the internal diam. of your hose. Most silicone tube has an ID of 4.5mm (OD about 5.5mm), so drill to this size, or even a fraction smaller, say 4mm. Cut your tube at an angle to make a point and pull it thru the hole with needle-nose pliers. It will seal 110%. Promise.