How do i make a button that can change the value of a text?

can someone help me pls

<p id="t">Hi</p>
<button id="b" onclick="changeText()">Change me</button>
<script>
function changeText(){
    document.getElementById.innerHTML("t") = "new text"
}
</script>

This is the basic idea, onclick isn’t very proper (you should use event listeners) but it works just fine.