How would I implement this parameter?

Issue:
I need to get the Group ID’s of all groups a user is in.
I don’t know how to include that within GetGroupsAsync

Relevant Code:

local GS = game:GetService("GroupService")
local PS = game:GetService("Players")
local PP = game.Players
local P
D.Touched:Connect(function(hit)
P = game.Players:GetPlayerFromCharacter(hit.Parent)
local Groups = GS:GetGroupsAsync(P.UserId)
end)

It says within the API that you can check for Group ID’s with GetGroupsAsync, but I don’t know where to put it in the line:
local Groups = GS:GetGroupsAsync(P.UserId)

Am I supposed to check for it with another function or something? Like:
Groups:GetId ???

GetGroupsAsync returns a table of group ids the player is in when passed their id. To access them you have to use a for loop or by indexing the table for specific elements.