We know how long you've wanted to learn how to do it yourself. After all, you want to know in advance the amount due for a refund! Even before filing a tax return.
We have prepared a detailed article where we consider the standard option - there is only one house in the mortgage, and it was issued not this year, but at least last year.
You can find the calculation of the mortgage deduction at link.