How to restrict movement to edge of screen?

Hello I really could use some help with this!

Within my game I would like to constrict the movement to with the screen, So that when my player hits the edge of the screen not all can the player not move any more, but it will result with death. How would I also be able to scale this to every type of screen (mobile) so that it can work across all devices?

How would I be able to accomplish this?

Check out camera frustum: