To establish how much you could afford to borrow you'll first need to determine your maximum allowable monthly repayment based off the lender’s affordability calculators. Each lender’s standard living expense may be slightly different and they could base this off your marital status and how many dependents you have or other factors.
Once you take away all your regular expenses, such as rent or mortgage repayments, living expenses, other loans, credit cards, and any other ongoing expenses from your net take home pay, if you are left over with a surplus amount, this should determine your maximum monthly repayment.
Next would be to determine how you would like your loan structured, that is, how many years you would like to take your loan over, or whether you would request for a balloon repayment at the end, or if you are looking to establish the maximum you could afford to borrow, the maximum term you can take the loan over based on the vehicle you are purchasing.
You would then need to try and estimate what kind of interest rate you would qualify for, so the repayment can be worked backwards to establish what the total borrow amount would be over the term of the loan requested, then take away any set up fees and you should be able to then work out how much you can borrow.
This can be done without actually establishing what interest rate you would qualify for, by working on an average and leaving a buffer and can be used as a guide, but would not be 100% accurate. This can also assist in giving you some sort of idea of what kind of car and in what price range you should be looking for.
Quite often people will have a different idea of what they believe they could afford as opposed to what the lender would actually allow as a maximum repayment. The main point that the lender will look at is the repayment fitting within their calculations, but they may at times restrict the borrow amount for first time or inexperienced borrowers and this would usually be to not over commit an inexperienced borrower into a loan product that could cause financial hardship down the road.