There are a lot of ways to do it..
- Store time since previous frame
- Poll for events
- If movement key held,
- set movement/direction flag for player sprite
- Update sprite ai based on time since previous frame
- if movement/direction flag on
- generate a rect for the proposed new location
- see if the new location only includes non-blocked tiles (background collision)
- If it doesn't, this is our sprite's new rect
- If it does, either
- do nothing (very basic) or
- move to the edge of the original position
This should work fine for objects that won't move fast enough to cover more than a tile per frame..
Is that what you were looking for? Or something even more abstracted like..
while True:
  tts = fpcClock.tick( FPS )
  held_keys = update_keys()
  draw_background()
  update_sprites( tts, held_keys )
  draw_sprites()
  pygame.display.update()