how to calculate accurately?


Chapter 1 of the following excellent book by Dan Heisman covers the topic of capturing/exchanging pieces and the calculation considerations, the pro's and con's, which affect/determine the final outcome of any tactic...
Back to Basics Tactics by Dan Heisman
(Note that while the content is the same, the formatting of the text in the Google Books excerpt - which is similar to a Kindle books format - is not identical to the format of the text in the print edition of book.)
https://www.chess.com/blog/RussBell/good-chess-books-for-beginners-and-beyond