For this demo I have a Categories List:

Open your developer Console of your browser, If your are using Chrome then Hit F12 and write this script in it:
document.location.href = SetUrlKeyValue("ID","5",true,ctx.editFormUrl);

After writing the script hit enter:

As you can see the edit form of the Item opened successfully based on the ID of the List Item.
This script based on the current opened list on the page because ctx variable store the information about the page so you can do most of the thing using with variable.
Other working scripts for this task:
document.location.href = SetUrlKeyValue("Title","Seafood",true,ctx.editFormUrl);
You can see whole bunch of information available in the ctx variable, just typing ctx in the developer console as shown in below image:

so many variables are available you can explore those by typing their name on console, another most important variable for SharePoint in "_spPageContextInfo"
Learn more! Explore more.....
Thank you