Remember pallet wood is sometimes contaminated due to what is transported on them. That's why they are usually free. Just be careful when you use them, sand them etc.
Just adjust dimensions for your needs.
something like this? https://www.hometalk.com/8149692/large-pallet-plus-fence-posts-equals-a-loft-bed
Just remember pallets are contaminated due to what they carried. Lots of time chemicals. Just an fyi. Be careful esp. If making a bed for children. There are reasons they are free.