The steps are simple:
Right click on Valheim in your Steam library and go to ‘Manage’ and then ‘Browse local files.’
That should bring up a window of Valheim’s game files.
Click on the valheim_Data folder.
Find the file named ‘boot’ or ‘boot.config’ and open it with Notepad.
Add “gfx-enable-gfx-jobs=1” as a separate line at the very top.
Add “gfx-enable-native-gfx-jobs=1” right below the first line.
Save and close the file.
Go back to Valheim in your Steam library, right click and select ‘Properties.’
Add “-windows-mode exclusive” into the launch options field.
Close that window.
Open up Task Manager (press Ctrl + Alt + Delete) and find Valheim under the processes tab.
Right click and select ‘Go to details.’
Right click valheim.exe, select ‘Set Priority’ and change it to ‘High.’
You’ll have to repeat this final step with Task Manager each time you launch the game.
Or go to the related reddit post here