How to test if a user is in another server discord.js code example

Example 1: discord.js check if member is in server

// guild = server
let guild = client.guilds.get('guild ID here'),
  USER_ID = '123123123';

if (guild.member(USER_ID)) {
  // there is a member in this guild with that ID
}

Example 2: how to check if the user is in a certain guild in discord

const server = client.guilds.cache.get(server_id)
if (server.members.cache.find(user_id)) //Returns true if present in the guild
else //and false if not