How do I make tiles/sprites player editable?

Very new to programming/game design in general though I’ve been having alot of fun making maps and exploring. I am guessing that that making tiles/sprites player editable (ingame) aka, putting a sprite down is some type of script? Will it be on a different layer or do I have to create sprite for each possible addition?

I’ll just keep searching until I find something but if someone could point me in the right direction as far as terminology goes that would be great.

ty

Tiles are rarely editable by the player, they serve more to show the world. Often an interaction from a player is done with objects. You can e.g. change/spawn an object. This object can have a sprite linked to it (e.g. with a property named “sprite”).
Like you suspected, this is done in code. You can do this from scratch or search for an engine which does this for you. In our game we started with MTE (Million Tile Engine) and added/removed functionality where needed.