Here's a guide.
1. Use synchronous design techniques, eg., use the 50MHz clock on your board.
2. Design a synchronizer component, eg., dual DFF for converting an asynchronous external signal to a synchronous signal
3. Synchronize the external push button signals and then debounce them, i.e., check that the button transition from high to low or low to high is clean. You might need to use a counter to decide that button transitions are only recognized if the button state changes and is held for say 10 clocks. The button change can be converted to a single clock period wide pulse, and this can be the enable for your counter that drives the hex display.
4. Design a hex to 7-segment display driver
5. Wire it all together
Don't go searching too far for source code, try and write it yourself, I'll show you examples if you cannot figure it out.
Are you writing VHDL or SystemVerilog code?
What board are you using?
Cheers,
Dave