This is simple and complicated at the same time.
Simple, because you’re not really saying “it”. We don’t have the third gender in Welsh, there is only he or she, so you choose one or the other as you please. Obviously, talking about people, the choice is made for you, but for objects and less specific things that’s where it gets more…
Complicated because every noun in Welsh has a gender - either masculine or feminine - and you should use the correct gender when your speaking. As a second language speaker, there is a good chance that you will never get all your genders right, and most of the time, no-one will notice. Sometimes gender is different in different areas, for instance “corner” is feminine in the north and masculine in the south. Tavern can be the same. Page, on the other hand, is the other way round… If you “get it wrong”, you might be “right” anyway, and no-one is likely to notice exept for the commonest of words.
One thing to bear in mind - things that aren’t really objects are usually “hi” (she). So, while “Teh Weather” is masculine, when we are talking about “It is warm”, wee say “mae hi’n dwym”, because the “it” here isn’t anything really. You could equally well point around you up and down at the air and the floor and each other and say “warm”. Bu even if you get this “wrong”, it will be barely noticed.
You’re right on the “fe/e” thing - use fe where there’s a vowel, and e where there’s not for masculine objects. Feminine objects are always hi, vowel or no vowel.
See, I said it was simple, didn’t I (runs away, suddenly realising how much “simple to a first language speaker” is “impenetrable to an early phase second language speaker”). You will take to it as second nature as you get more used to the language, so just roll with it, and accept that sometimes you will say it differently to us, and it doesn;t matter!