How do I remove the void between parts of one track?

Hi, how can I connect parts of one track and get rid of empty sections automatically?
Screenshot_1.png

“Ctrl + A” to select All,
then
“Edit menu > Clip Boundaries > Join”