Я прошел полный элемент, поэтому вам не нужно использовать идентификатор / класс.
function changeType(element) {
element.classList.toggle("active");
}
.buttonCloserGreen{
height: 45px;
min-width: 200px;
margin-bottom: 10px;
border: 2px solid #53DD6C;
border-radius: 8px;
background-color: #ffffff;
box-shadow: 4px 4px 20px 0 rgba(35, 31, 32, .05);
transition: opacity 200ms ease;
transition: transform 200ms cubic-bezier(.175, .885, .32, 1.275), opacity 200ms ease;
font-family: Poppins;
color: #53DD6C;
font-size: 14px;
line-height: 40px;
font-weight: 700;
text-align: center;
letter-spacing: 0.5px;
text-transform: uppercase;
cursor: pointer;
outline: none;
}
.buttonCloserBlue{
height: 45px;
min-width: 200px;
margin-bottom: 10px;
border: 2px solid #0491F2;
border-radius: 8px;
background-color: #ffffff;
box-shadow: 4px 4px 20px 0 rgba(35, 31, 32, .05);
transition: opacity 200ms ease;
transition: transform 200ms cubic-bezier(.175, .885, .32, 1.275), opacity 200ms ease;
font-family: Poppins;
color: #0491F2;
font-size: 14px;
line-height: 40px;
font-weight: 700;
text-align: center;
letter-spacing: 0.5px;
text-transform: uppercase;
cursor: pointer;
outline: none;
}
.active{
background-color: black;
}
<button class="buttonCloserGreen" onclick="changeType(this)" id="myDIV">
Free
</button>
<button class="buttonCloserBlue" onclick="changeType(this)" id="myDIV">
Paid
</button>