Welcome!
There are many ways to know if a player tries to stand on a wall/obstacle (this is called "collision detection"!)
If your walls and obstacles are sprites, functions like SPCOL and SPHITSP should do the trick :)
Otherwise, I think you would have to write your own code for collision detection.
Thankfully, you're not the first person to ask about this.
I found a thread here that gives a code example for collision with BG tiles: https://old.smilebasicsource.com/forum?fpid=10102#post_10102
I also found this video about sprite collision, made by the SmileBASIC developers: https://www.youtube.com/watch?v=scr1gsOG3q4
Collision detection can be a bit tricky for beginners, so if you still have troubles, let us know!
I have a question
YossiManCreated: