If you want the loop markers to be set to the current media or range selection, Transport > Loop Selection.
If you want it to automatically do that, right click the record button in the transport and turn on Loop Follows Selection.