Measure the length of the end of the bed. You don't want a chest that sticks out past the edges of the bed, as you will find yourself constantly banging your shins on it or tripping over it. You should take around 5 to 10 inches off the length of the end of the bed to get an approximate length of the chest.
Measure the height of your bed frame as well as the mattress. A chest shouldn't be higher than the mattress, otherwise it can disturb your feet at the end of the bed. If you are considering using the chest as a seat, it shouldn't be higher than around 25 inches including the width of the cushion seat, otherwise it will become difficult to sit on comfortably.
Measure the distance between the end of the bed and the wall, or any other piece of furniture opposite the end of the bed. You don't want your chest to be so wide that it leaves no room to maneuver around the bed. Ideally there should be 40 inches of free space between the end of the chest and the wall for easy access around the room. So, if there is 60 inches between the bed and the wall, your chest can safely be around 20 inches wide.