Hello and welcome to the forum. You have asked a very very involved and complex question. In short yes binary was and is used to program computers. Binary is a numerical system based on two states 0 and 1. We normally work in denary which is a numerical system based on 10 digits ie 0 to 9. We use that system because we have ten digits or fingers. Computer programers because every piece of electronics that enable a computer to run is based on a system if switches and switches only have two states ie on or off. The on state is represented by a 1 and the off state is represented by a 0. Whilst programing in 1s and 0s can be and is used it can be very time consuming and takes all of your mental skills to bring about a result so programming languages were developed such as C, C+, CC+, Fortran etc. There are lots of different progarmming languages and these languages are specific to a programming task, They try to use a logical command rather than a series of 1s and 0s to perform a certain task within a program. But the bottom line is that all programming languages can be broken down to the base language used which is binary.
I'm afraid that that is a very simplistic explanation and really if you want more knowledge and experience in this sort of stuff you really need to study computer science. I am by no means an expert on these things but I was brought up using personal computers such as the Sinclaire ZX80 which had to be programmed in binary code to perform very simple tasks such as drawing a mono coloured circle on the screen. That bit of binary coding actually took up a large part of the page in the Sinclaire magazine that attempted to teach us computer sprogs how to program. I never did learn how to do it and eventually just went down the road of building, using and repairing computers and letting others do the programming.