Start by playing alongside your child but let them take the lead. Engage when they talk to you but sit back a bit when they are focused on their activity and don't commentate which can break their concentration.
Once they are happily engaged, say you need to step away to get a drink and quickly leave but return in a minute or two so they learn that you will be right back.
Next time, step away to "use the bathroom" for a minute or two longer.
Slowly increase the time you are gone so that your child feels safe knowing you will return. You don't have to leave the room but you can step back to do a task such as laundry, dishes, or reading a book.