It was known and used, just that there wasn't enough incentive for massive extraction so it wasn't searched. It's population growth and in conjonction with it urbanisation, electrification and railroads that lead to the search of more efficient energy source.
Nothing really prevented people from using coal earlier and they did but keep in mind that town where smaller and people scattered about in lots of smal villages. It was easier to collect wood.
Remember that by the end of 18h century, only a handful of cities barely reach a million inhabitant.