Add setTimeout for a beginner

Hi, I used code to get a modal to load upon visiting my homepage, but I would like to set a 3-second time delay. Here is the existing code:

window.onload = function () {
document.getElementById(“matt-modal-1-anchor-toggle”).click();
};

What code can be added to delay the action by, let’s say, three seconds?

Thank you in advance!
Signed, A Beginner :slight_smile:

Look up setTimeout().