How to learn while playing?

I consider myself to have a good basic understanding of gates and bits but sometimes when I'm stuck I end up just guessing signals or gate arrangements and while I can arrive to a solution, it feels like I'm not learning and just doing random stuff until I get the solution right. Any way to approach this?