I want to create levels for my sidescroller, enemies show up and leave after a specific time (if not all killed). Is there any best practice for doing that ? Wonder why I don’t find anything, Im sure others also do things like that - or am I on a complete wrong way?
No there is no best practice for doing this.
The design of the system you implement into your game to manage such a thing will highly depend on other design factors of your game.
To hopefully answer this you should consider instantiating enemies and having a timer on each of them, once the time is over they will be destroyed. Also consider refreshing the timer if a player comes near them or how ever you want to do it.