Héilics Órbhuí

There is no rule relating to ending consonants and declension patterns. There is a general trend for words ending in slender consonants to be 2nd declension and broad ones being 1st declension but this isn’t an absolute rule by any means. Unfortunately you just have to learn what gender/declension each noun uses. There are other small trends like words that end in -úb or -úg tend to be feminine but again this is not an exact rule (I think the only exception I’ve found is “ciúb”, which is masculine). I believe one of the few absolute rules is that all nouns ending in -eog or -óg are feminine 2nd declension. I made a study of this at one point and identified some general trends but no definite rules:
Feminine nouns ending in broad consonants include almost all nouns…
… ending in -eab (except geab)
… ending in -lann (except anlann, comhlann, salann)
… almost all multi-syllable words ending in -acht (exceptions include arracht, uireacacht and many single syllable nouns)
… ending in -iall (except giall)
… ending in -íob, -íoc, -íog, -íon, -íor (exceptions include fíon, líon, gíoc, etc) (this is relevant to your question)
… single syllable nouns ending in -ead (except cead)
… ending in -arg (only exception I’m away of is dearg when used as a noun)

Conversely, here are some trends I’ve found that are more common in masculine nouns than feminine ones:
all nouns ending in -ae
all multi-syllable nouns that end in -é
most single syllable nouns ending in -cht
most single syllable nouns ending in -ith
most nouns that end in -aí (if it describes the doer of an action)
most multi-syllable nouns that end in -aire (except: pónaire, trócaire, ending in -mhaire, and most -uaire)
most nouns ending in -áire (except: náire, táire)
most nouns that end in -éir (except: mistéir, and single syllable words)
most multi-syllabel nouns that end in -óir or -eoir (except: altóir, onóir, seanmóir)
most nouns that end in -úir (except: staidiúir, and single syllable words)
most nouns that end in -ín (except: ainsín, aintín, braillín, ladhraicín, muinín, muirín, scrín, splín)
most nouns ending in -inse (except: foinse, inse, lainse, proibhinse)
most nouns ending in -inte (except: sláinte)
most nouns ending in -iste (except: aiste, timpiste, tubaiste, among others)
all nouns that end in -itse
most nouns ending in -éile (except: féile)
most nouns ending in -ice (except: aice, toice)
most nouns ending in -ite (except: eite, leite)

These trends should be taken with a grain of salt. They only allow you to increase the probability that an educated guess about the gender of a noun will be correct. They are not rules and are probably not anything you’ll find in any grammar book. They are statistical trends I’ve observed studying a master word list of my own that I have compiled over time using various dictionaries and other sources.