How to use wait until the page is loaded or element is displayed

I got this error:
org.openqa.selenium.NoSuchElementException:
Timed out after 2 seconds. Element not found
For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html

My code snippets:
@Given("^(?:.*) is at the add new goal page$")
public void maryIsAtTheAddNewGoalPage() {
goalPage.addNewGoal();
}

In my pageObjects class
public class GoalPage extends PageObject {

public GoalPage(WebDriver driver) {
    super(driver);
    
}

@iOSXCUITFindBy(accessibility = "btnAddNewGoal")
@AndroidFindBy(accessibility = "btnAddNewGoal")
private WebElement addNewGoalButton;

public WebElement getAddButton()
{
return addButton;
}

how can I inspect the element is visible or the page is loaded?

No such element exception appears when that element that you are trying to interact is not there. maybe to put an explicit wait to wait visibility of element located is a good option. You can set the timeout for that wait as well.
sth like this :
WebDriverWait wait = new WebDriverWait(driver,15);
wait.until(ExpectedConditions.visibilityOfElementLocated(addNewGoalButton));