Nearly all people I've asked have told me that Slovenes, Croats, and Serbs have existed as distinct ethnic groups prior to the Ottoman Empire's conquest of the Balkans and that Bosniaks were the result South Slavs that accepted Islam and wanted to be considered distinct from Serbs and Croats. And that at some time when they would do their ethnic census, Bosniaks were originally called "Muslim" before the term "Bosniak" started being used. Here is an example of what I'm talking about.
There is one problem with that theory though. prior to the Ottoman conquest of Europe, Bosniak empires did exist - two of which are the 'Banate of Bosnia' and the 'Kingdom of Bosnia'. So this kind of shows that Bosniaks existed as a people similar to the Croats, Serbs, etc. did prior to accepting Islam and are not just a new ethnicity born out of Ottoman conquest.
Also, if you could please talk about the origins of Bosniaks cause I think that would really simplify things.
Bosniaks definitely are Slavs, and muslims, but claims that they are islamicized Croats or Serbs are quite meaningless. But before going into that, I must point out the difference between "muslims" and "Muslims". In socialist Yugoslavia, after the new ethnicity was officially recognized, it was named Muslims (with capital), while muslim (without, and unlike in English a normal way to write the name of religious group) remained a name for religious group.
Ottoman empire incorporated Bosnia from early 16th century. It also ruled for some two centuries in Slavonia and large part of Hungary. In all those areas significant parts of population converted to Islam. There are multiple interconnected reasons and it is impossible to single one out. Claims of Bosniaks being islamicized Serbs or Croats usually also stress the Ottoman pressure, mostly through taxes. Indeed, non-muslims payed somewhat larger taxes, but Ottoman policy was opposed to forced or conversions under pressure. For one, conversions were supposed to be freely chosen to be honest, but also it reduced somewhat the tax income. Islam however was quite attractive. Among other things, it proposed a direct relationship between faithful and God, unlike Catholic or Orthodox mediation by priests, and like Protestantism that was spreading at similar times, 16th and 17th century. (For South Slav lands, Protestantism was rather confined to north-west, and area was soon re-catholicized).
Anyway, significant number of Slavs converted to Islam, in Bosnia, in Slavonia, in Hungary. Very few people actually moved into the area as muslims. When "Turks" are mentioned in sources and particularly in epic tradition of South Slavs, it is synonymous with religion, not ethnicity. As Habsburgs reconquered the later two, muslims (without capital - religion) were given a choice between converting to Christianity or GTFO. By the time Austro-Hungary occupied (1878) and annexed (1908) Bosnia and Hercegovina such things were no longer considered very nice, and beside large expulsions would destabilize the area, so muslim communities were preserved.
All of the above is basically an introduction and some context to the question of religion and ethnicity you pose. The thing is, religion was and is the major differentiation factor between three Bosnian peoples. But it is very tricky to discuss ethnicity in the area before national movements in the 19th century. At the time of conversions to Islam, while Croat and Serb names were sometimes used, those titles were mostly insignificant in peoples identities. They are usually anachronistically applied backward in time, so ascribing primacy to either one is quite meaningless.
When nations were being formed in 19th century it was based on religion, church and state tradition. For Croats, it was Kingdom of Croatia, somewhat distinct within Hungary, Catholic faith as differential in relation to Othodox and Islam. For Serbs it was also a matter of a sort of state, as a part of Ottoman empire, but much more significant was Serbian orthodox church as distinct within Ottoman millet system. Millet system didn't encourage a distinction for Muslims as it did for other faiths, but there was a sense of local identification with Bosnia (however, likely unconnected with medieval Bosnian kingdoms).
First ideas of separate ethnic / national identification for Bosnian muslims appeared late in 19th century, a bit after national identifications spread in Croatia and Serbia proper, and more or less concurrently with those "leaking" into Bosnia and Hercegovina. But, ideas of muslims in Bosnia being islamicized Croats or Serbs also developed during 19th century.
In Kingdom of Yugoslavia, 1918-1941, no separate Muslim or Bosniak ethnicity was recognized, although there were political organizations of Bosnian or rather Yugoslav muslims. In socialist Yugoslavia, a third nation was recognized, capitalized Muslim. Unofficially in the 1980s, and officially in 1990s name Bosniaks was adopted.
Personally, I prefer to ahistorically use the term Bosniaks for two reasons. One is clarity, especially in English to avoid the muslim / Muslim confusion. Second, more important, is that we usually do the same with other ethnic / national names, Croats and Serbs. It is a somewhat standard practice to apply national names retroactively, once nations are defined, to people in the past, so I don't see why Bosniaks should be an exemption, except to deny their nationhood and continue to claim that they are actually Serbs or Croats but have, due to Islam, forgotten it.
To make all of that a bit clearer (although it is anything but), when asking were Bosniaks distinct from Croats and Serbs before Islam, it is not at all clear what they were supposed to be distinct from.
For more modern consequences, "Bosniaks are Islamicized Croats/Serbs" was used as a reason to try and "return" them to their proper nation (in Kingdom of Yugoslavia, during Second world war), or alternatively the identification of Turks and muslims was used to point out their "foreign" nature, that just had to be cleansed - ethnically of course (Second world war, wars in 1990s).