When I first purchased my plant, it was healthy and lively, but now it's scrawny and skinny. I don't know the name of my plant and how to care for it.
What Is This Plant and How to Care for It
Certified GKH Gardening Expert
I believe this to be a Yucca plant.
There are many different varieties of these type of plants.
It may be a variety that would do better outdoors, but would likely not be outdoor hardy in your growing zone.
Here are some links for you.