NATO has provided security to the Baltic countries. The only reason that Russia has attacked Ukraine and not Latvia, is because Latvia is in NATO and Ukraine is not.
In fact, Russia is suffering big losses in its war in Ukraine. It would have taken Latvia instead without much trouble.