Search online for something like “Unity supporting multiple screen sizes”. There’s a lot to understand about the subject. There are Unity tools that can make this easier, but with their own cons.
Unfortunately I can’t just solve this in a small reply like this. The general idea is you’d have to tell Unity what should be visible, what should resize itself to be part of the screen, and what should be cropped out. The “Lazy” solution is to define a screen ratio, like 16:9, and resize the whole screen to fit that ratio. This results in empty borders either vertically or horizontally, but is the quickest solution.