A list of transactions has a date on every row and you want one total per month.
The reliable formula method is SUMIFS with two date conditions: on or after the first day of the month, and before the first day of the next. Write the month as a real date, such as 1 Jan 2025 formatted as "mmm yyyy", and let the formula work out the boundaries.
=SUMIFS($B$2:$B$13, $A$2:$A$13, ">="&D2, $A$2:$A$13, "<"&EDATE(D2,1))
The ampersand joins the operator, written as text, to the date in D2. EDATE adds one month to get the start of the next month. Using "less than the next month" instead of "up to the last day" is safer, because it also catches dates that carry a time of day.
Lock the ranges with $ so the formula can be filled down, and leave the month reference relative so each row picks up its own month.
A common shortcut is =SUMPRODUCT((MONTH(A2:A13)=1)*B2:B13). It works, but it adds every January, from every year in the data. Add a year test if the list spans more than twelve months.
For a one-off summary, a PivotTable is quicker: choose Insert > PivotTable, put the date in Rows and the amount in Values. Right-click a date, choose Group, and select Months (and Years). The Analysis track shows how to build a full summary table with formulas.