Foreground and background jobs examples in bash

Let's run 2 jobs: one foreground and one background:

$ sleep 500
^Z
[1]+  Stopped                 sleep 500
$ sleep 200 &
[2] 12671
^Z means that Ctrl+Z was pressed which stopped the jobs. You can view them by:
$ jobs
[1]+  Stopped                 sleep 500
[2]-  Running                 sleep 200 &
To make job 1 run in background:
$ bg %1
[1]+ sleep 500 &
$ jobs
[1]+  Running                 sleep 500 &
[2]-  Running                 sleep 200 &
To make job 2 run in foreground:
$ fg %2
sleep 200
It will take the cursor and will not release until it finishes or until you interrupt with Ctrl+Z/Ctrl+C:
^C
[2]-  Done                    sleep 200