It's hard and something I struggle with a lot. I try to do open source work in my free time, the problem is the company gives me almost no free time (start up life lol). However, there are times where I'll say, this weekend I need to get X open source thing done.
Hackacthons are also great, the last austin pleb lab hackathon I got to do some open source work that I've wanted to commit some time to and was able to accomplish a lot!