You have plenty of time, so start with basics. First get a copy of Rick Steves Europe Through The Back Door (library or used bookstore copy is fine, as it need not be the most recent edition). This will have a lot of the "nuts and bolts" of European travel - how to handle money, food, transportation, etc.
Next, do as much research on UK destinations as you can. Figure out what places draw you the most. Look at as many different UK travel books as you can (raid your library). Watch travel videos; to see Rick's videos, scroll down and click Great Britain: https://www.ricksteves.com/watch-read-listen/video/tv-show
Rick's books are very selective. What they cover, they cover in great detail - and they omit everything else in a country. So, while he will be very helpful for a first time visitor to London and Edinburgh, do look at other sources to find other places you may want to visit, that he doesn't cover. Also note that his England and Scotland books have some destinations that his Great Britain book does not; again, for research, make sure to look at the separate books.
For seeing London and Edinburgh, it's definitely better to stay in the cities themselves. I'll join the chorus in recommending Premier Inn and Hub by Premier Inn. In addition to being predictable and good value, one other benefit is that this is where lots of British people stay when they travel within their country, so you will meet lots of locals in the breakfast room! Of course, there are other places to stay as well. As for "affordable," do note that London is more expensive than Edinburgh, and Edinburgh in turn is probably more expensive than many other places in the UK. For instance, for my upcoming September 2018 trip, I'm paying an average of £103 per night for London (Hub by Premier Inn, including £5 extra per day for breakfast), £64 per night for York (Travelodge, including £3 per day for internet), and £86 per night in Edinburgh (Travelodge, including £3 per day for internet). As you see, you do have to watch the "upcharges" with hotels, but even with these, they can be a good deal. Do note the comment that the regular room at a Hub by Premier Inn is SMALL; even for one person, it can be claustrophobic, and for two it's definitely tinier than I'd want. The non-Hub locations of Premier Inn have more "standard size" rooms (still small by US standards, but not claustrophobic for two).
Some places are easy to see as daytrips from London or Edinburgh, while others are better as a separate stay. For instance, you can certainly do a quick visit to Liverpool as a daytrip from London, but there is more than one day of sights there - if they interest you. So, where to say will be determined by what you want to see.
How long is your trip? What is your home airport? You definitely want to try to fly into London and out of Scotland, or vice versa, to avoid backtracking. Even if this "costs more" (and it may not), you save time and money not backtracking. To find these flights (it's too early for November 2019, as flights become available about 330 days out), use the "multi city" or "multiple destinations" option on flight websites like Kayak, Google Flights, airline websites, etc.