You work out the amount by seeing how your meter reacts. I used 40 carbs for a meal, then saw how my meter readings were. I took 150g a day as my starting point.
That might work for you. Try it and see what happens. If you get a high reading on,say, 50g a meal, then drop to 40g the next time, and so on.
We are are different, so your meter will tell you what level is safe for you. And keep checking as your safe levels may change over time.
The post by Daisy1 has a table of safe post-meal levels for type 2's