Create plugin for Calculate method of Totals Information ManagementInterface Magento 2.

Magento 2,  You can create a plugin to TotalsInformationManagementInterface of Checkout Module to modify or change quote total.

An Interface responsible for Calculate quote totals based on address and shipping method.

Interface class:
Magento\Checkout\Api\TotalsInformationManagementInterface

An interface contains the calculate() method to fetch quote totals based on the address and shipping method.

if you need to modify the total information you can use before plugin based on your total customization.

Path: app/code/Jesadiya/TotalInfo/etc/di.xml

Now you need to create a PHP class file to defining our logic before calculate the final quote total.

Path: app/code/Jesadiya/TotalInfo/Plugin/TotalsInformationManagementPlugin.php

Using the above method beforeCalculate() you can modify the behaviour of the calculate method.

You can also use AfterCalculate() method if you want to change the total info after the final total calculated.