It affected them by killing or maiming large numbers of them.
Depending on the estimate, 20-26 million people in the USSR died as a result of the war, with about half of those being military deaths. Women served in front-line Soviet units, but they represented about 3% of the total Soviet WW2 military personnel, so the majority of the military deaths were men. Captured Soviet troops were deliberately mistreated and killed en masse by the Germans, with about 3 million perishing after being taken prisoner.
The number of casualties relative to 1939 population was far higher in the Soviet Union (~13%) compared to the Western allies (1% for Britain, <1% for the US) or even Germany (~8%). Only Poland lost a greater percentage of its 1939 population.
The human losses in the USSR were colossal. The Red Army lost close to 5 million men in the first 6 months after Operation Barbarossa was launched. Conscription was expanded to nearly all able-bodied adult men to replace these losses. Besides the dead, many more were maimed and disabled as a result of the war.
By 1946, the sex ratio (men:women) in Russia fell from 0.91 to 0.65 for the 20-29 age group. It was already lower than 1:1 prior to 1941 due to the after-effects of the Russian revolution, civil war, and famines. So for every woman in that age cohort, after WW2 there were only 0.65 men. Consequently, the birth rate fell from 34.6 per 1,000 population in 1940 to 26 in 1946. The post war period saw changes in Soviet divorce law, child care provisions, abortion law, and other matters resulting from the male deficit and the need to rebuild the population.
Harder to quantify are the psychological effects from living through brutal combat, losing family members and friends, having one's home destroyed, and seeing the aftermath of Nazi war crimes. These scars presumably stayed with many of the veterans for the rest of their lives.
Stats from: Elizabeth Brainerd, Uncounted Costs of World War II: The Effects of Changing Sex Ratios on Marriage and Fertility of Russian Women.