Sample Code:
Map<Id, List<PermissionSetAssignment>> mapUserIdPermAssignList = new Map<Id, List<PermissionSetAssignment>>();
List<PermissionSetAssignment> listPermAssign = [SELECT AssigneeId, PermissionSetId FROM PermissionSetAssignment];
for(PermissionSetAssignment PA : listPermAssign) {
if(!mapUserIdPermAssignList.containsKey()) {
mapUserIdPermAssignList.put(PA.AssigneeId, new List<PermissionSetAssignment>());
}
mapUserIdPermAssignList.get(PA.AssigneeId).add(PA);
}
here mapUserIdPermAssignList contains User Id and their related list of Permission Set.
Cheers!!!