Well, to help the original poster out with some broad ideas:
Think about storing an array that will act as a grid for your snake game. Most snake games run on a grid. Think of storing the type of thing in each location in this array, e.g. wall, snake, or empty. Detect collisions by checking whether the next block you will move to is empty. Keep track of the current direction of the snake; this determines the next block you will move to. You could make collision detection into a hard problem, but it’s almost trivial if you use a grid and should be sufficient for making a snake game.
You also need to think about whether your snake will move in 3D, or whether your snake will move in 2D but the camera can move in 3D. Think about controls - how will the player control the movement?
Seriously, I think the OP asked a completely legitimate question. The format of their question was: Here’s what I want to do; how do I do it? Isn’t that the format of every question asked on these forums? We’re not going to write their code for them; that’s one thing for certain. But, we respond to provide help and ideas. Why can’t people ask for ideas?