Mapping two tables dynamically in ms sql

Hi, I want to map two tables dynamically that have data like below and what kind of result I want is also posted there. Please help me with how I can get this result.

TABLES:

CREATE TABLE #A
(
NAME VARCHAR(10),
NUMBER INT,
ID VARCHAR(5)

)

INSERT INTO #A VALUES ('JOHN', 20,'J10')

CREATE TABLE #B
(PRODUCT VARCHAR(10),
NAME VARCHAR(20)
)

INSERT INTO #B VALUES ('APPLE','JOHN, HARRY'),('ORANGE', 'JOHN,MIKE') ,('MANGO','JOHN, KATTY, ALEX')

image

The result should be like below:

+--------+-----------+-----------+--------------+---------------------------
|NAME | NUMBER | ID | PRODUCT |
+--------+-----------+-----------+--------------+-------------------------
|JOHN | 20 | J10 | APPLE |
|--------|-----------|--------------|----------------|--------------------------
|JOHN | 20 | J10 | ORANGE |
+--------+-----------+-----------+---------------+------------------------
|JOHN | 20 | J10 | MANGO |
+--------+-----------+-----------+---------------+-------------------------
|MIKE | 2 | M5 | ORANGE |
+--------+-----------+-----------+---------------+-------------------------

You should take a loot at example B on this page:

B. Split comma-separated value string in a column:

STRING_SPLIT (Transact-SQL) - SQL Server | Microsoft Learn