How to back viewmodel up when close to basepart

how do I back my viewmodel up when close to wall, I need an actual explanation, I tried using raycasts but results were buggy and not really what I wanted, so how can I do it with raycasts but it working, or other method

I could of sworn I never capitalized the h in how