To do this, you can use the below steps:
First of all, press the Windows logo + A to open the Quick Settings window.
Now click on the pencil icon to edit the quick settings menu.
Click on the Add button and select Accessibility from the menu list.
Then click on the Done button to save the changes.
Open the Accessibility menu and turn on the toggle for Live captions.