Well, there's no such thing as a "proper technique" when it comes to composing. Different things work for different people. For instance, I have just started working on a new piece, but instead of going straight to Finale, I tried handwriting the theme along with a few chord changes. I've never handwritten anything of substance before, and it's doing wonders for my inspiration! Also, try to give yourself enough time to allow the theme to develop in your head before you even touch the piano. I usually come up with a very simple theme in my head, and (if it's good enough) I'll just keep thinking about for at least a few days, if not weeks. This process allows me to plan ahead and figure out where I want the theme to go. There are much more qualified people on here that could answer this question, but this is just my take on it. Oh, and welcome to YC!!!