Russia is under U.S. sanctions. How does Russia have so much foreign exchange reserves?
Russia has been ramping up its production of oil since late 1990s after it defaulted on its debt. It has been maintaining positive trade balance since then.
Also, notice in the above graph, Russia has had current account surplus for a long time. It is somewhat similar to saying that Russia has been a net lender to the rest of the world. The current account surplus has increased Russia's net foreign assets, this situation puts Russia among the top countries with the highest foreign reserves.
Also, the sanctions did not target oil and gas industry as much as the financial, agriculture, weapons and other industries.