The key to using prime lenses effectively is to use them enough that their field of view becomes instinctive to you, so that you can stand somewhere and know what the resulting image will look like, without even looking at the viewfinder. Then, rather than watching your camera, you watch the world, and when you see a photograph, you take it.
With a zoom lens, there's a temptation to point your camera at your subject and then compose your photo. Of course with a prime lens you still will use the viewfinder for exact framing (along with shifting your position as needed), but it lends itself to a technique where you visualize the desired result first, which can help make you a better photographer.
The answer to when to switch lenses comes naturally from this approach. You switch when you know you want a different perspective. Generally, I choose a lens and try to stay in its "mindset", and switch when I feel that doesn't match the scene, or when I see a different creative possibility called to mind by my knowledge of the other lenses in my bag. And then I stay with that lens until the same occurs.
So the next part is: how do you get to the point where this comes naturally? The answer is basically measured in hours — there's no substitute for the familiarity which comes from use. For this reason, I think focusing on just one lens for a while is a very worthwhile exercise (for a beginner or for anyone). Don't worry about being too limited: working within constraints is a fundamental tool for making good art. And don't worry about missing shots: we're surrounded by missed photographs all the time, and it's impossible to take even a fraction of them no matter what equipment you have. Every real-world camera and lens restricts the infinite possibilities in some way. Focusing on what the gear you have with you can do actually frees you up to take real photographs from that vast infinity.
The two specific focal lengths you have correspond to very classic fields of view in photography: a standard wide angle and a "normal". This isn't necessarily universal, but I've noticed that many photographers tend to feel at home with one of these two and find the other a bit awkward. They're both very versatile focal lengths suitable for many different types of photography. I tend more towards the normal and switch out for a much wider ultrawide when I want that perspective or a much narrower portrait telephoto for details. Even though the two lenses you have don't really overlap, you might find them to be awfully close in the way you might use them.
So, I'll repeat again the usefulness of spending a good, long quality time so you get to know each one, and then you can decide if you can relate to what I'm saying here. If you do, you'll probably make one of these lenses your main squeeze — and you'll probably also know what perspective you feel like you're missing and what lens to look for next as a secondary. Or maybe you'll find that both of the lenses you have do suit you well in different situations — and you'll know what those are.