The breakup of Czechoslovakia and that of Yugoslavia occurred at around the same time, and are both often mentioned when discussing a post-communist resurgence of nationalism, but they were very different political situations. I can't speak too much to Yugoslavia, which was a very complex situation, but I can explain to some extent what enabled the peaceful breakup of Czechoslovakia. I should first point to a very good post by u/AlviseFalier that sets out the reasons behind the breakup. Essentially, maintaining the binational state after the fall of communism became too difficult, because the Czechs and Slovaks supported different political parties with diverging goals. These parties weren't able to come to a compromise about what Czechoslovakia should look like, but they were able and willing to negotiate the dissolution of the country.
This was made easier because the borders of the Czech lands and Slovakia were basically not contested. Neither state had any irredentist claims on the other. (I am compelled to include that there were actually some minor border disputes involving a train station in one town, a couple of houses in another, and a little recreational center in the mountains, but this proves my point.) Only 3% of the population of the Czech lands was Slovak, and 1% of the population of Slovakia was Czech. Contrast this with Croatia, where 12% of the population identified themselves as Serb prior to the outbreak of conflict, and were concentrated in specific areas. Furthermore, while there were certainly some historical grievances between the Czechs and Slovaks, they pale in comparison to those that existed between the different nationalities in Yugoslavia.
The dissolution of Czechoslovakia and the breakup of Yugoslavia are results of a completely different situation and history. There are so many factors for peaceful dissolution of Czechoslovakia that it is possible to say simply that there was no reason for a violent conflict. Even the Constitutional act establishing the Czechoslovak federation in 1969 the preamble states that both nations recognized the federation as a voluntary and consesual union of two nations having right to separate. The main problem was that the "federalized" communist Czechoslovakia was governed by the unitary Communist party. There was an article in the Constitution granting the Communist party a "leading role". After the Communist "leading role" was removed in 1989 it became gradually apparent that the federation is actually disfunctional, because there was no real inner common political force keeping it together.