Once you have the before tax amount take away the tax free allowance to give you your taxable income. Then multiply this amount by the tax percentage e.g by 0.4 for 40%. Obviously this depends on the tax structure of your particular country. Then add the tax amounts to get total amount of tax paid.
So say 40000 before tax. Minus 5000 non-taxable, leaves 35000.
Maybe next 10000 is taxed at 20% (10000x0.2 = 2000), then remaining 25000 at 40% (25000 x 0.4 = 10000), so you would pay 12000 in tax. Note this is a fictitious tax structure just for example purposes, hence no currency denomination.
Just break the calculation down into the steps outlined above.
If you're budgeting, don't forget to take into account NI contributions, student loan repayments etc. that will also be taken along side tax
Hope this helps