When I program an FPGA, it is very similar to conceiving an integrated circuit.
I always have a set of requirements, from either a paying customer or from internal means. The requirements tell me what the FPGA is supposed to do -- what it is supposed to control; how many pins are needed for inputs and outputs; what the clock frequency is; or if there are multiple clocks; and what the functions are inside.
I will map out block diagrams of' all the functions inside the FPGA, and map out all the pins, then make connections one the block diagram.
After making block diagrams, then I write hardware description language code to implement the functions. I like Verilog but if I have to write in VHDL I can do that, too. Software tools "synthesize" the code into gates, flip-flops, and connections.
At the same time, the Verilog or VHDL code can be loaded into a simulator to simulate what the behavior of the FPGA will be.
Finally a place-and-route software tool takes the synthesized netlist and virtually creates the places where all the gates and flip-flops will go, and routes the connections between them.
The final binary file is used to make the physical connections between the real gates and flip-flops in the integrated circuit.
The FPGA may now be validated by electrical testing.
.