It makes it hard to help yo when yo havne't provided any sample data or expected output. Additioanlly, you didn't describe how the two queries relate. However, I assume that they are related on the Name0 column. Here are some links on how to ask your questions in the future to help us provide you with better answers:
Again, without knowing anything about your table structure or relations, I tried to take the two queries you provided and made derived tables out of them. However, I suspect that this can all be done without derived tables (just joins). If that doesn't work, pleae follow the links I provided above and provide more information.
* -- Put the columns you want here
v_AgentDiscoveries AS AGD
dbo.v_GS_COMPUTER_SYSTEM AS CS
ON CS.ResourceID = AGD.ResourceID
AGD.AgentName = 'Heartbeat Discovery'
) AS A
v_R_System AS sys
v_GS_OPERATING_SYSTEM AS os
ON sys.ResourceID = os.ResourceID
v_FullCollectionMembership AS fcm
) AS B
ON A.Name0 = B.Name0