Hello and welcome. Everyone does that differently. I like to do it in the game properties setting where I pick change width or height (depending what makes sense for the layout) to fit screen or window size and update resolution during game. This needs repsonsive ui and background and could possibly need a centering action in your events (depending on the game). Possibly other things as well depending on the game. Others like to make their game property “no changes to game size” and then use events like “activate fullscreen yes keep aspect ratio no” in their game logic to handle that. I can’t say how that works because I have never needed to do it.
I don’t get black borders because of my settings and game design. Also I design my background for different sizes, for example if it’s one image I set up a tiled sprite background that expands or shrinks to the window size. However I did recently read a post in the same thread that Bubble is linking above. The post I was most interested in was SilverStreak’s as it is so simple and elegant an idea if you want to get rid of black bars but for some reason want it to still look framed.