I am booking the ticket online.
There is a choice of 'Pay for bed clothes'.
What does this mean? If I do not tick it, then I will get the bed clothes used by the previous guy?
When you take an overnight train in Russia and you book a sleeping compartment (there are two classes of these), the compartments come with a mattress and a pillow.
For the additional option you have asked about,
Pay for bed clothes, an attendant will come around and deliver a bottom sheet, top sheet, a pillow case, and a blanket. It's impeccably sanitary and well-advised for this reason.
If you do not purchase the option you get the standard mattress and uncased pillow, less sanitary. You do not get the previous passenger's stuff (except his detritus); previously used bed clothing gets collected by the attendant.
When you buy tickets into any carriage except one with places for seating only (ICE fashion carriages) you are provided with a mattress, a blanket and a pillow which you can only use with the bed clothes provided by the train staff. You cannot use them with your own bed clothes and you cannot use them without bed clothes at all.
Yes, you can spend the entire journey without those items - that makes sense if your journey takes up to several hours. If you decide you need the bed stuff you can pay for it either when buying the ticket or after boarding the train. In the latter case you'll have to pay cash to the train attendant and of course you'll have to pay in rubles and the sum may be not very round - something like 183 rubles (instead of 200). This is why you better pay for them when buying the ticket if you decided that you need them at all.
As others have noted, if you pay for bed clothes, you get some basic clean clothes and you are allowed to use a mattress, pillow and a blanked. If you do not pay, you can use neither. You can pay both while booking a ticket (more convenient as you can use a credit card, etc.), or right in the train, but be ready the the sum might be really odd, up to some kopecks.
Those cases when one does not pay for clothes are mostly as follows: