Many ways to solve this
For beginners I recommend installing visual studios code as it can edit things in sudo mode
code.visualstudio.com/
1. Download the .deb file
2. It will show up in your downloads folder
To install it
3. Navigate to downloads folder in terminal or by going to the file explorer and right clicking when in downloads and select "open terminal here
The type "sudo dpkg -i code" then hit the tab button and it'll fill out the rest of the file name (it needs the entire file name, tab auto fills things once it only has one option)
That should install it
Now navigate to the grub file in file explorer, right click and select open with code.
Now you can edit like any text editor. When you save you will get an error saying run as sudo and click yes. That should solve it
Vs code is also great for editing gcode files and such