Using your system in either vertical or horizontal placement is perfectly fine, since the console is designed for both. Just make sure you use the stand, no matter which orientation you decide on. You can technically position the console vertically without a stand, but it's much easier to tip over and being on the ground makes it more susceptible to dust.
The original PS5 comes with an adjustable base that works in both positions, but the PS5 Slim and PS5 Pro only come with horizontal stands; vertical stands are sold separately for $30. Cleaning out dust optimizes the console's ability to circulate air, but all that work isn't as effective if you place the console improperly.
Make sure there's at least four inches of space between the console and walls, preferably with nothing overhead. Don't place the console in a cramped space like the inside of an entertainment center. It's also wise to clean the area where your console spends most of its time. Wipe down the dust and vacuum the space well so you don't have to open your system for cleaning as often.