The North Atlantic Treaty Organization (NATO) owes its existence to the North Atlantic Treaty of 1949 (sometimes referred to as the Washington Treaty).
The Treaty was signed on 4 April 1949 by 12 founding members. The Treaty derives its authority from Article 51 of the UN Charter which reaffirmed the inherent right of independent States to individual or collective defence.
Collective defence is at the heart of the Treaty and is enshrined in Article 5 - NATO - Topic: Collective defence - Article 5
On 24 February 2022, NATO issued a Statement about Ukraine - NATO - News: Statement by the North Atlantic Council on Russia's attack on Ukraine, 24-Feb.-2022
Ukraine is not a member of NATO but there is an important relationship which is set out in this webpage published by NATO - NATO - Topic: Relations with Ukraine. Crucially, NATO’s practical support for Ukraine is set out in the Comprehensive Assistance Package (CAP) for Ukraine. In June 2017, the Ukrainian Parliament adopted legislation reinstating membership in NATO as a strategic foreign and security policy objective. In 2019, a corresponding amendment to Ukraine’s Constitution entered into force.
UK Parliament and NATO - NATO - UK Parliament
25 February 2022