Shavua Tov. The subject of the death of Miriam follows the discussion of the פרה אדומה. The Gemara said that the connection between the two is that just as the Red Heifer atones, so, too, does the death of צדיקים.
The תורה תמימה asks why this is the example of כפרה, atonement. Sacrifices and the בגדי כהונה, priestly garments, also atone.
The answer given is that the connection between Miriam and פרה אדומה, is that we say by the Red Heifer that the mother should come and clean up after the baby. The baby is the עגל הזהב. Similarly, Miriam was like the mother of the nation. She also cleaned up and guided the people. Hence, the connection between the פרה אדומה and the death of Miriam.