To upgrade a WSL distro from WSL 1 to WSL 2, run wsl --set-version <name> 2 in PowerShell or Command Prompt. To make every distro you install from now on use WSL 2, run wsl --set-default-version 2 once. New installs have used WSL 2 by default for years, so this is mostly for distros installed a long time ago.
Check Which Version Each Distro Uses
wsl -l -v
The VERSION column says 1 or 2 for each distro, and the name in the first column is what the next command needs. More on reading this list is in How to Check Your WSL Version.
Convert a Distro to WSL 2
# Change Debian to the name from wsl -l -v wsl --set-version Debian 2

The conversion copies the distro into a new virtual disk, so it takes a few minutes on a big distro and needs free space on the drive while it runs. If the distro holds anything you would miss, back it up first. More on wsl --terminate and wsl --shutdown is in How to Restart WSL. Run wsl -l -v again afterwards and the version column says 2.
If it fails with a message about the Virtual Machine Platform, that Windows feature is off. WSL 2 runs in a lightweight virtual machine and needs it. Turn it on from an elevated PowerShell window, then restart Windows:
# Elevated PowerShell. Restart Windows afterwards wsl --install --no-distribution
That installs the WSL pieces (including the Virtual Machine Platform) without adding another distro.
Make WSL 2 the Default for New Distros
wsl --set-default-version 2 # confirm it wsl --status
wsl --status shows the default distro and the default version. It does not change any distro you already have; those keep their own version until you convert them.
Going Back to WSL 1
Run the same command with a 1: wsl --set-version Debian 1. Reasons to do that are rare now; they are in How to Downgrade from WSL 2 to WSL 1.
Every other WSL post on this site is in the WSL Complete Guide.