How can I edit file in JavaScript?

I want to be able to:

-edit the data of a .dat file on my computer for a website.

-pull data from the file to use it later on.

I know a tiny bit about javascript and heard javascript cannot directly edit databases.

Is a .dat file in my computer a database?

I have done a few things in Javascript for websites but I haven’t done anything complicated completely myself. I created some websites before and I have a basic understanding of HTML and CSS.

Please phrase your response as simply as possible. Explain the meaning of any complicated but necessary terms.