I want to set new object in local storage
Probably you want to add note into your existing localStorage data so here you can check if there is userNote is already set before then take it or set an empty array,
let notesObj = JSON.parse(localStorage.getItem("userNote")) || []

Your whole function would be like this,
function addNote() {
    const givenTitle = document.getElementById('titleInput');
    const givenNote = document.getElementById('noteInput');
    
    let notesObj = JSON.parse(localStorage.getItem("userNote")) || []

    let myObj = {
        title: givenTitle.value,
        note: givenNote.value,
    }

    notesObj.push(myObj)

    localStorage.setItem('userNote',JSON.stringify(notesObj));
}


function addNote() {
    const givenTitle = document.getElementById('titleInput');
    const givenNote = document.getElementById('noteInput');
    
    let notesObj = []

    let myObj = {
        title: givenTitle.value,
        note: givenNote.value,
    }

    notesObj.push(myObj)

    localStorage.setItem('userNote',JSON.stringify(notesObj));
}

This code is everyTime changing the older value I want to get a new object in local storage
