Query to partially summarize data in a table using SQL
It's indeed a very basic concept: aggregation. You need the GROUP BY clause:

SELECT member_id,
pay_year,
SUM(pay_unit) AS sum_pay_unit
FROM payments
GROUP BY member_id, pay_year;