Simple positioning problem for child element

If what you want to achieve is the buttons to be vertically aligned on the same line, you can simply use CSS flexbox in .whole. By forcing the flex direction to column and then forcing spaces to be inserted between its children via justify-content: space-between, you can pretty much achieve what you want:

let content;
for (let i = 0; i < 4; i++) {
  if (i % 2 == 0) {
    content = "Stack Overflow is a question and answer website for professional and enthusiast programmers. It is the flagship site of the Stack Exchange Network,[4][5][6] created in 2008 by Jeff Atwood and Joel Spolsky.[7][8]"
  } else {
    content = "Stack Overflow is a question and answer website for professional and enthusiast programmers."
  }
  document.body.innerHTML += `
<div class='whole'>
<p>${content}</p>
<button class='buttons'>Click</button>
</div>`
}
body {
  display: grid;
  grid-column-gap: 50px;
  grid-row-gap: 50px;
  grid-template-columns: repeat(2, auto);
}

.whole {
  width: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.buttons {
  position: relative;
  width: min-content;
  left: 100%;
}