How to find the xpath of the button in a class. Please find the attachment of the same which i have uploaded:

How to find the xpath of the button in a class. Please find the attachment of the same which i have uploaded:

Try this,
driver.findElement(By.xpath("//button[@data-target='@exampleModal1' and contains(text(),'Register')]"));
As the element is a <button> tag simply identifying the element may not suffice to your usecase further you may need to invoke click() method on the element.
To invoke click() on the element as the element is within a Modal Dialog Box you need to induce WebDriverWait for the element to be clickable and you can use either of the following solutions:
cssSelector:
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("button.btn.btn-info.btn-lg-block.w3ls-btn1.px-4.text-uppercase[data-target$='exampleModal1']"))).click();
xpath:
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.id("//button[@class='btn btn-info btn-lg-block w3ls-btn1 px-4 text-uppercase'][normalize-space()='REGISTER']"))).click();
Try this using CSS Selector. Make sure to use proper waits
driver.findElement(By.cssSelector
(.btn.btn-info.btn-lg-block.w3ls-btnl.px-4.text-uppercase)
).click();
Here type should not be used as it is not a node/tag name
driver.findElement(By.xpath("//div[@class='buttons']//button")).click();
//driver.findElement(By.xpath("//div[@class='buttons']/type")).click(); WRONG
Make sure element should not be in frames else we have to first switchTo frame and then perform findElement
driver.switchTo("frameName/ID")
.findElement(By.xpath("//div[@class='buttons']//button"))
.click();
Element should be loaded before click, you can use wait statement for this