Add a state variable inside the contract:
uint256 public total;
Watch the right panel. A storage slot appears, labelled with the name you just typed. That slot is where the value lives between transactions.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Vault {
// Your state goes here.
}