You can make a huge map, the maximum the editor will allow. And a small window.
The most important thing is to use the environment correctly.
You need to optimize everything that is not on the screen at the moment. For example, disable collisions and behaviors of enemies you can't see. If there are large sprites you can even unload and load them to save memory.
This requires development experience.
An easier option is to make game obstacles such as a passage in a cave or an elevator that instantly transfers to another layout.
Take your pick.