Software, as you likely know, is what runs on a computer to perform tasks and maintenance, such as applications or even the very operating system you run on your personal laptop. Usually spacecraft run what's considered a software stack, with many different pieces of software that covers a variety of different purposes. Any task that requires electronics also requires software. Taking communication for an example: you need software to send the data to the antennae properly AND to confirm the data was sent properly to its destination. Another example would be GN&C: software is necessary to communicate information to Earth, to have our lander or satellite adjust course if necessary, to track current position, and many other aspects which are too miniscule to be named.
Whereas avionics are like the electronic brains of the spacecraft, software serves as the instructions, telling itself how to perform necessary self-maintenance, collect data, adjust guidance, and many other tasks. Many scientists use languages such as C and C++ to program mission-specific instructions or executions and integrate it into the design. Python is becoming an increasingly releveant solution as well, given how easy it is to create working code with it and how many APIs there are to interact with the hardware and other pieces of software.
Software must also be able to pass information back and forth, and communciation specific software exists to aid with that.
While you can use SSH to remotely access your spacecraft, it would be long and slow, so engineers include all they can before they launch it. Additionally, in order to communicate, web designers create UIs using JavaScript, HTML, and CSS to interact with the spacecraft.
MatLab and other scientific analysis tools are used in the design of the spacecraft to ensure that the design works well. CAD software such as Solidworks is used to design most aspects of spacecraft. Many may use sketching software to create schematics or a general concept of how it will look.
Github is the world's largest location of open source software, which means the code behind the software is publicly provided, and often it goes hand in hand with being free. The open source community, while heavily involving companies, consists of a massive community of hobbyists and hackers who are passionate about well-written and functional software. Linux is a community based on this philosophy, and our spacecraft will run a Linux-based system, just like the ISS does.
For just an example of how open source software can be used in these projects, the Ingenuity Mars Helicopter drew from open source projects and had 12,000 contributors working on the software stack. This is incredibly useful not just for our spacecraft, but for anyone who wants to contribute to projects like these.