Google Search is fine with using either subdomains or subdirectories. Making changes to a site’s URL structure tends to take a bit of time to settle down in Search.
So Google recommends picking a setup that you can keep for longer. Some servers make it easier to set up different parts of a website as subdirectories. This helps Google with crawling since it understands that everything’s on the same server and can crawl it in a similar way. Sometimes this also makes it easier for users who recognize that these sections are all a part of the same bigger website. On other servers, using subdirectories for different sections, like a blog in a shop, can be trickier, and it’s easier to put them on separate subdomains. That also works fine.
The thing is you’ll need to verify subdomains separately in Search Console, make any changes to settings, and track overall performance per subdomain. So in short, use what works best for your setup and think about your longer-term plans when picking one or the other.