I need ideas. I want to change this railing to a wall and some type of wall unit
I would replace it, making sure the footings were able to support a lot of weight. You can run a 4 x 4 at the corner from the floor to the ceiling, making sure you attached to a 2 x 4 in the ceiling. Then 2 x 4s every 16 inches to the wall. Even if there is just 4 inches, you still need the last 2 x 4 for support. You can then cover the 2 x4s with paneling or sheetrock. Place cross boards in between the uprights at about 3 foot. Cover the stair side.
No railing in picture, just a tv and tarp
If you have the tools and some construction knowledge you should be able to do it. However, since you are here asking it may be more than you should tackle. You need to put an electrical outlet on your TV wall, and the half wall needs to meet code. I suggest you interview a few contractors before you try to take this loft apart. The back side of your TV wall will go about 16 feet above the room below. Not many DIY's can lift a sheet of wall board that high.
I'm with V as to you needing a professional to do what you want to do. What I would do is remove the railing and make a "wall" for the tv with some open (especially at the top, going all the way to the ceiling) and some closed (to hold electronics and tv) shelves. That way you let some light in and still block all of the cords. Be sure to run plenty of electric sockets for anything you might want to add in the future. Then on the side where the bookbag and other bag is, remove the railing and build a wall of cubbies for storage or decorative accents. You could add doors if you want. Then attach the handrail to that.
DIY or not, you need to follow local code. Many municipalities have on line. This looks like you are trying to partially enclose a loft? If you need to hire a contractor, here is how:
Is there another wall where you can place your TV? Making a wall here would make the area seem claustrophobic, in my opinion.
If you want to build a wall there, the best thing to do is hire a contractor.