const userId = 1

const i = myArray.findIndex((user) => user.id === userId)

state.splice(i, 1)