Focus Sash is a held item that allows a Pokemon to live on 1 HP from an attack that would otherwise KO it if its HP is full; if this effect triggers, the Focus Sash is consumed. Think of it like Sturdy, but as a one-use held item.
In a standard, casual playthrough, Focus Sash is unlikely to have much of an effect/be of much use. However, in the very niche case that you are struggling against a particular major battle because they keep outspeeding and OHKOing your Pokemon, you can attach a Focus Sash to one (or multiple) of your Pokemon, live a hit, and fire back with your own move to KO them. There are usually much better ways to deal with such obstacles, but if you have to, use Focus Sash in conjunction with a strong attack as a guaranteed method of dealing with a trainer's Pokemon if they keep outspeeding and OHKOing your Pokemon.
In competitive Pokemon, Focus Sash is commonly seen in the lead slot, or a Pokemon whose sole purpose is to lead off the battle and do something. Commonly lead Pokemon currently are Landorus-T, who sets up Stealth Rocks and can Explode; Hatterene, who sets up Trick Room, denies opposing hazards, and either sets up Healing Wish or Explodes; and Ribombee, who sets up Sticky Web and Stun Spore despite being incredibly frail. Because these Pokemon fulfill such important roles (and can easily be OHKOed by certain Pokemon without Focus Sash), they have to use Focus Sash to guarantee those one or two free turns to do what it needs to do. Therefore, in the competitive scene, Focus Sash is best paired with early game supporting options, such as entry hazards or Trick Room, on dedicated lead Pokemon (otherwise called suicide leads).
There's also some Pokemon that aren't suicide leads, or intend to stop opposing suicide leads. In Generation 4, prior to its ban, No Guard Machamp with Dynamic Punch is an incredibly common counter-lead, built to stop the likes of lead Azelf and Heatran from setting up Stealth Rocks for free. It sometimes uses Sash so it can live a hit guaranteed, as in the case of Azelf, for example, it has to use the combination of Payback and Bullet Punch to KO Azelf, thus needing to tank a Psychic. This is kind of like the first example, where Focus Sash is paired with strong moves to KO certain threats, especially opposing leads.
There are also Pokemon who use Focus Sash and setup options to grab themselves a free turn to set up. The most recent example is Ceruledge, who uses Swords Dance to get the +2 Attack boost, and if the opposing Pokemon uses a strong Physical attack, like Earthquake, Ceruledge will not only live thanks to Focus Sash, but will gain a +2 Speed boost thanks to its ability Weak Armor. The more common examples are with Shell Smashers, most commonly Cloyster and Polteageist. However, due to commonly being relegated to 1 HP, they are basically never used outside of Psychic Terrain teams, as Psychic Terrain blocks priority. Nevertheless, they are still ruined by Sandstorm (and Hail in past generations) and any entry hazard bar Sticky Web. If you do use this type of Pokemon, pair Focus Sash with a powerful setup option, such as the aforementioned Swords Dance or Shell Smash.
I want to mention VGC quickly, as they have Focus Sash equipped on a much wider range of Pokemon. One example is Urshifu, as both forms of Urshifu are known as extreme powerhouses, yet they can be KOed easily by a wide variety of moves, especially in restricted formats. Therefore, some players opt to give them Focus Sash to live a hit with ease. Entry hazards aren't a matter of worry in VGC, sandstorm and hail are practically nonexistent in restricted formats, and Psychic Terrain, although more niche, can be set up thanks to Indeedee. Because it is much easier to maintain the Focus Sash, it can be given to powerful but frail Pokemon that usually won't use it in Singles, with other examples being Chien-Pao and, more recently, Sneasler. In VGC, Focus Sash can be given to any strong Pokemon that doesn't have many methods of staying alive, so again, pair it with strong moves.