The interest rate of loans are often naked rates and doesnt include the fees. So first we need to calculate APR. For more information check out the APR calculator. Than this rate used to find out monthly payments and their interest and principal parts. With these information we can build the payment schedule also called amortization schedule.
The interest and principle parts of the monthly payments are calculated with the remaining part of the loan and the monthly rate. So if the APR is 4.5 and your loan is 40000$ your first payments interest part is 150$. It is not related to the principle. Next month it will drop as the remaining loan is decreased. When you subtract this number from your monthly payment you can find the principle of the payment.
Lets go on with the above example and assume our loan term is 24 months and with 300$ fees. Now our monthly payments are 1759.01$ and 150$ is the interest, 1609.01$ is the principal. Next month the interest part is dropping to 143.97$ and principal increased to 1615.04$ This indicates that we start to pay more of the interest part in first months and as the payments progress the money spent to interest decreases. It also tells us that we might want to use down payment instead of close early. For comparison you can use our Down Payment Calculator