In the blog i am going to tell you that, how can you display related products in a tab at single product page. For that, you need to use below snippet.
Where add custom code:
Add this custom code to your site child theme functions.php file or add this code to your site to using any third party code snippet plugin. Like this one ( https://wordpress.org/plugins/code-snippets/ ).
After adding this custom code to your site, a new tab will added to your single product page and when you going to click the tab then related products will display under the tab. See below screenshot
Related products in a tab.