First, from Mail’s View menu, choose Show Sidebar (or Show Mailbox List on older versions of macOS) if necessary so that the mailboxes are visible.
Junk Mailbox
If you’re using the recommended setup described in Setting the Junk Mailbox in Apple Mail, the special Junk mailbox should always be visible within each account. To see the spam messages from all accounts consolidated into a single All Junk mailbox, you can click the + button next to Favorites at the top of Mail’s mailbox list and then add the All Junk mailbox to the favorites.
Spam Mailbox
If you are instead using a Spam mailbox under On My Mac, it is most likely it’s still there but Mail is currently hiding it. To show the Spam mailbox: