Then create it using the UI Document component (aka UI Toolkit). 
I’m torn between saying “reinventing the wheel, waste of time” and “curious, I want to do so myself”. 
Be sure you have very, very, very good reasons before you dive into this as it will be way more challenging and time-consuming than you might think. Particularly if you want to handle resolutions and aspects well. Not to mention all the feedback cues that users will come to expect, the mouse over, the selected, the pressed state of a button - omit just one of these and the UI feels unresponsive.
As to handling aspects, just make sure to anchor your content to one of the main anchors: the four screen corners, the four screen edge centers (ie left center), and the screen center itself. If that doesn’t suffice for your UI and HUD then definitely make sure that all UI coordinates are relative screen coordinates in the range 0,0 to 1,1.
For screen resolution it’s hardly enough to do a 1.5x scaling when the UI is designed for 1280x720 but the resolution is 1920x1080. Bad example because in this case it will probably work fine, but it may not be fine with odd resolutions (eg scale like 1.4375) and a change in aspect ratio too (you need to pick either width or height for the scale factor).
Scaling images would lead to aliasing of the UI images and text, even to the point where a string of consecutive letter looks like this “IIIIIIIII” (some letters are wider than others). It gets particularly worse if the UI images are point filtered pixel art images and fonts. You can really only scale them by multiples ie 2x and 4x.
The most important advice here is to set limits. If you know the game is designed for 2k/4k and 16:9 resolutions then absolutely use these and ignore everything else as much as possible. You’d support scaling the UI by 2x and that’s it. Even “close enough” aspects will work fine when using edge/corner anchors since that aspect simply has marginally more vertical pixels.
You should edge/corner anchor UI elements and don’t worry too much about crazy aspects like 5:4 (there may be overlap) or 32:9 (works but UI elements are awkwardly far away), or at best accomodate a special mode ie assuming a 16:9 ratio on a 32:9 screen either using black borders or anchoring UI elements to the 16:9 ratio relative to the screen center (ie corner/edge-anchored UI elements will be at 25% and 75% of screen width) while still allowing the viewport to expand horizontally to the full width.
The more you worry about making it work with uncommon aspect ratios and resolutions the more work you’ll have on your hands, like this tends to grow exponentially and only serves a greatly diminishing number of players.
Also know your UI. If you want to create a Tycoon game like the classic Transport Tycoon Deluxe which had an OS-like windowing system with scalable and movable windows, with many nested and scaling elements, then you may be spending a year trying to figure this out. If however your game is something like Broforce or Vampire Survivors where each screen corner has some clearly defined HUD element (health bar, score, selected weapon) and a menu screen with classic Doom-style selection/navigation, only then will it be as easy as Baste implies.