all excellent advice.
try keeping a diary for a while, noting what you have eaten and insulin taken - you should be able to see a pattern that will give you a clue as to your personal ratio.
Eg to take a very simple example - if your bg was ok before you ate, you had 40g carbs and 4 units fast acting insulin, and at the next meal your bg was still pretty much ok, a 1 to 1 ratio is what's right for you for for that meal. (10g carbs = 1 carb portion).
If at the next meal you were a bit high, try a 1.5 to 1 ratio. So for your 40g carbs you'd take 6 units of insulin. For a 2 to 1 ratio you'd take 8 units for your 40g carbs. And so on.
It's slightly more complicated than that coz you also have to work out if your background insulin dose is right, but that's a good starting point.