Converting a decimal number to a binary number is easy. You just have to divide the decimal number by 2. If the division yields an integer, note 0, otherwise 1.
Now take the integer part of the division and divide it again by 2. Here, too, the value 0 or 1 is determined analogously.
This is done until the result of the division is 0.
Here is an example: