Most government spending comes out of the "general fund" which is a mix of many different sources of revenue which aren't specific to a particular expenditure.
For example, in the United States, income tax receipts and proceeds from the sale of treasury bonds go into the "general fund".
When funds from a particular source are earmarked for a particular expense, which is the exception, but not terribly uncommon, the treasurer of the governmental entity establishes a "fund" for accounting purposes from the earmarked revenue source and only authorizes expenditures from the fund for purposes authorized by the legislation establishing it.
For example, in the United States, Medicare and Social Security taxes go into a "trust fund" which is limited for use for Medicare and Social Security, although all of its excess cash flow is invested, by operation of law, in treasury bonds which make the excess funds available to the "general fund" which an obligation to repay the trust fund in the future that is effectively unenforceable since the United States government can't sue itself and no one would have standing to enforce a claim in that situation.
Similarly, when taxes on vaccines are collected, those moneys go into a fund earmarked for compensation on people who have adverse reactions to vaccines.
Government entities generally issue publicly available reports at least annually detailing the source and uses of money in every fund in its accounting system that has a non-zero or more than negligible level of activity.